What is difference between a PROCEDURE & FUNCTION ?

Answers were Sorted based on User's Feedback



What is difference between a PROCEDURE & FUNCTION ?..

Answer / anil kumar jampana

sorry, we can use in,inout,out parameters in functions also.
one more diff. we can use functions in normal sql queries
but we cann't use procedures in sql queries....

Is This Answer Correct ?    9 Yes 0 No

What is difference between a PROCEDURE & FUNCTION ?..

Answer / ace

A function is a special kind of procedure. A function
returns a value in its name. A function can return more
than one value if it returns a ref cursor.

Is This Answer Correct ?    0 Yes 0 No

What is difference between a PROCEDURE & FUNCTION ?..

Answer / naresh bs

The main difference is that, a procedure may return and
value but a function has to return a value.

Is This Answer Correct ?    0 Yes 0 No

What is difference between a PROCEDURE & FUNCTION ?..

Answer / pankaj mehra

Well the main difference between procedures and function is
that the procedure may/may not return any value.it can
return more than one value also.
but functions can return only one value at a time and it
must have return keyword inside the function

Is This Answer Correct ?    3 Yes 4 No

What is difference between a PROCEDURE & FUNCTION ?..

Answer / surajit pathak

We can use in,inout,out parameters in functions also.
The most important difference is we can use functions in
normal sql queries if it is not containing any out
parameters.
but we cann't use procedures in sql queries....

Is This Answer Correct ?    1 Yes 2 No

What is difference between a PROCEDURE & FUNCTION ?..

Answer / chandrasekar.ramasamy

Function accepts only in parameter but procedure accepts
in,out and inout
Function mostly used for mathamatical calculations
But procedure used to execute business logics

Is This Answer Correct ?    0 Yes 11 No

Post New Answer

More SQL PLSQL Interview Questions

How do you pronounce sql?

0 Answers  


Can we create clustered index without primary key?

0 Answers  


What is sql architecture?

0 Answers  


Can we write dml inside a function in sql server?

0 Answers  


if table named a is there and 4 records are there then how to swap (1 and 3) and (2 and 4) records at a time

1 Answers  






Can there be 2 primary keys in a table?

0 Answers  


how to shut down the server with 'mysqladmin'? : Sql dba

0 Answers  


I want to display the employees who have joined in last two months. (It should be executed randomly means If I execute the query in March it should display Jan and Feb joined employees. Same query if i execute in Feb, 2007 it should display dec, 2006 and jan 2007 joined employees.

15 Answers   Wipro,


how to fetch alternate records from a table? : Sql dba

0 Answers  


Types of locks in database ?

8 Answers   HCL, TCS, Tieto,


When can we use the where clause and the having clause?

0 Answers  


Which is better stored procedure or query?

0 Answers  


Categories