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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which tcp/ip port does sql server run?

524


How do you run a query?

585


Does user triggers have entry for trigger with compilation errors?

588


Can we use rowid as primary key?

539


Define union, minus, union all, intersect ?

551






What does trigger mean in psychology?

531


what are the differences among rownum, rank and dense_rank? : Sql dba

534


Explain the difference between cursor declared in procedures and cursors declared in the package specification?

573


What is indexing oracle sql?

556


Which sql most popular?

546


Why is sql important?

575


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

1716


Is sql port 1433 encrypted?

570


Explain the components of sql?

587


What is the maximum number of rows in sql table?

540