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


Please Help Members By Posting Answers For Below Questions

Can we create a qtp test from qc?

591


How to handle dynamic objects in quicktest professional?

503


How to creating an output value using quicktest professional (qtp)?

570


What is synchronization point in QTP?

678


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 ?

1557






Is it possible to split an action? How?

662


When Recovery scenario actually starts while testing the application?

1548


How are actions and functions different in QTP?

660


How to use the object spy in quicktest professional 8.0 version?

548


How many types of recording modes in the qtp?

598


How many types of run modes are there in qtp?

590


Hybrid framework supports Descriptive programming. Is it true?

656


Explain features of the latest version of qtp/ uft 12.1?

608


what difference between runtime object and text object and what property they have. whether they have same properties or different properties.

1709


after click on compose mail how can we attached a file in qtp with vbscript code

1619