GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL

 Print  |  
Question:  Difference between procedure and function.


Answer:
Functions are named PL/SQL blocks that return a value and can be called with arguments procedure a named block that can be called with parameter. A procedure all is a PL/SQL statement by itself, while a Function call is called as part of an expression.


November 11, 2005 03:07:22 #1
 Abhineet Jindal   Member Since: Visitor    Total Comments: N/A 

RE: Difference between procedure and function.
 
The main difference is DML (Data Manipulation). Through Stored procedure you can manipulate data i.e u can insert,update,delete records from table but in function u can't manipulate data. then comes secondary differences like function returns a value and stored procedures does not until and unless u specify an output parameter.stores procedure is a precomplied function i.e it has to be complied oly once but a function when called is complied again and again.
     

 

Back To Question