What is difference between function and procedure?
Answer Posted / gunesh
1.Function is mainly used in the case where it must return
a value. Where as a procedure may or may not return a value
or may return more than one value using the OUT parameter.
2.Function can be called from sql statements where as
procedure cannot be called from the sql statements.
3.Functions are normally used for computations where as
procedures are normally used for executing business logic.
4.You can have DML (insert, update, delete) statements in a
function. But, you cannot call such a function in a SQL
Query.
5.A Function returns 1 value only. Procedure can return
multiple values (max 1024).
6.Stored Procedure: supports deferred name resolution.
Example while writing a stored procedure that uses table
named tabl1 and tabl2 etc...But actually not exists in
database is allowed only in during creation but runtime
throws error Function won’t support deferred name
resolution.
7.Stored procedure returns always integer value by default
zero. whereas function return type could be scalar or table
or table values
8.Stored procedure is precompiled execution plan where as
functions are not.
9.A procedure may modify an object where a function can
only return a value The RETURN statement immediately
completes the execution of a subprogram and returns control
to the caller.
| Is This Answer Correct ? | 13 Yes | 6 No |
Post New Answer View All Answers
Explain the concept of object repository and how quicktest professional recognises objects?
Hi all Can u give me the link where we can download full version of qtp my mail id is karthic.venkitapathi@gmail.com
how to find that tools work well with ur existing system?
What are the different recording modes?
In qtp, explain what is qrs file?
How do know the number of browsers opened?
HOW AUTOMATE TEST SCRIPT ? what time it will do? after gneration of basic script or Any , Plz explain detailed?
What test cases can you automate using QTP?
Tell me about qtp?
How qtp recognizes the object?
What is keyword view?
How do you open adobe acrobat file in QTP and do some testing on that file ?
can any boby tell me what is method or steps to connect the remote desk top by using QTP 9.2 version?
What is output value? How many types of output values are there in qtp?
How to create a standard checkpoint ?