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
diff between qtp versions from 8.5
Does quicktest professional is unicode compatible?
Can anyone pls tell me how to do action parameterization (input and output parameters) with respect to login window and insert order of flight reservation window in detail( pls give a clear step by step explanation with example) anyone please. Will be very thankful to u
how do u plan test automation?
How will you declare a variable in qtp?
How to upload excel files into Quality Center using QTP Script and how to delete excel files from Quality?
What is synchronization? What are the ways you can synchronize?
What is checking bitmaps?
describe some problems that u had with automating testing tool?
Is there any relation between Keyword Driven Framework and Recording modes provided in QTP( whether Recording modes are applied on keyword driven framework or not?)
Plz Explain AUTOMATION REFERENCE MODEL?
What is the limitation to XML Checkpoints?
Can anyone pls tell me in realtime (descriptive programming) how will the properties of the object be given to the test team. R they given in an excel sheet and is the same sheet also given to the development team and by whom is this given? Thanks a lot.
How to get popup error message.
What is the syntax to call one script from another? And what can be the syntax to call one “action” in another?