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
Can we create a qtp test from qc?
How to handle dynamic objects in quicktest professional?
How to creating an output value using quicktest professional (qtp)?
What is synchronization point in QTP?
what is key word driven frame work ? why it is called like that ? what is the diference between keyword driven and data driven frame work ?
Is it possible to split an action? How?
When Recovery scenario actually starts while testing the application?
How are actions and functions different in QTP?
How to use the object spy in quicktest professional 8.0 version?
How many types of recording modes in the qtp?
How many types of run modes are there in qtp?
Hybrid framework supports Descriptive programming. Is it true?
Explain features of the latest version of qtp/ uft 12.1?
what difference between runtime object and text object and what property they have. whether they have same properties or different properties.
after click on compose mail how can we attached a file in qtp with vbscript code