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. Source: CoolInterview.com
Function and Procedure both are PL/SQL blocks, main difference between function and procedure is - Function has to return some value using return clause whereas procedure may or may not return any value( no out parameter).
We can use functions in SQL query but can't use procedure. Source: CoolInterview.com
Answered by: manish | Date: 1/29/2009
| Contact manish
The procedure may or may not return the value to the calling environment, however the function must return the value to the calling evironment. Source: CoolInterview.com
Answered by: Sumeet Huddar | Date: 4/24/2009
| Contact Sumeet Huddar
PROCEDURE:it may or may not return a value. FUNCTION:Should and must return a value. Source: CoolInterview.com
Answered by: nandu | Date: 9/4/2009
| Contact nandu
Procedure may or may not return a value but function must return a value.
Procedure may return multiple or more than 1 value where as fuction always return single value. Source: CoolInterview.com
Answered by: Shaikh Rehana | Date: 2/2/2010
| Contact Shaikh Rehana
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|