what is the differnce between procedure and function?
in both dml operations can work and in procedure through out
parameter you can return value ,then what is the differce?

Answers were Sorted based on User's Feedback



what is the differnce between procedure and function? in both dml operations can work and in proce..

Answer / rajesh venati

1. Procedures are used to perform a particular task.
2. Procedures may or may not return a value, if u want
return a value though the OUT parameter it is possible. It
doesn't contain any RETURN key word.
3. Procedures are not valid in SELECT statement.



1. Functions are used for computation purpose.
2. Function must and should be return a value.
3. We can execute function in a SELECT statement.
-- If u use OUT or IN OUT parameters or perform any DML
operations on functions it is not valid in SELECT statement.

Is This Answer Correct ?    4 Yes 0 No

what is the differnce between procedure and function? in both dml operations can work and in proce..

Answer / dinakar

Though Procedure returns a value through OUT parameter, it
cannot be used in SELECCT statement. Whereas a function can
be called in SELECT statement.

Is This Answer Correct ?    2 Yes 0 No

what is the differnce between procedure and function? in both dml operations can work and in proce..

Answer / gavini srikanth

function can return value,procedure may or may not return
value,through procedures can store images

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More SQL PLSQL Interview Questions

name 3 ways to get an accurate count of the number of records in a table? : Sql dba

0 Answers  


What is the maximum number of triggers,can apply to a single table?

2 Answers  


What is cross join example?

0 Answers  


What is a trigger in sql?

0 Answers  


Is time a data type in sql?

0 Answers  






Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10

0 Answers  


Which tcp/ip port does sql server run?

0 Answers  


how are mysql timestamps seen to a user? : Sql dba

0 Answers  


How to recompile a already made trigger?

2 Answers  


i have a table eno dno sal 1 10 200 2 10 150 3 10 100 4 20 75 5 20 100 i want to get sal which is less than the avg sal of thri dept. eno dno sal 2 10 150 3 10 100 4 20 75

12 Answers   IBM,


what are local and global variables and their differences? : Sql dba

0 Answers  


Is pl sql a scripting language?

0 Answers  


Categories