What is difference between function and procedure?

Answer Posted / anurag arun edlabadkar

Question: Difference Between Procedure &
Function?
1). Both functions and procedures can return values.

2). Both can return multiple values, like in the case of
procedure it can return multiple values using OUT and INOUT
type parameter, while in case of function used in Report 6i,
using "PLACEHOLDER COLUMN" you can return multiple values.

3). "Complete Reference" Book say that function can use
parameters as IN, OUT, and INOUT as same as in Procedure.

/*

create function syntax

The syntax for the create function command is more
complicated than the syntax for the create procedure
command. At a high level, the syntax is

create [or replace] function [schema.] function
[(argument [in | out | inout ] [nocopy] datatype
[, argument [in | out | inout ] [nocopy]
datatype]...
)]
return datatype

*/

4). Function returns value using "Return" Key Word, where
same key word can be used in Procedure to Terminate the
program, with immidiate effect.

5). Functions are used for computations where as procedures
can be used for performing business logic.

6). Functions MUST Return a value, procedures need not be.

7). You can have DML(insert,update, delete) statements in a
function.

8). You can call a function in a Select Query where as
not Procedure.

9). Function returns 1 value only where as Procedure can
return
multiple values(max. 1024)

10). A procedure may modifiy an object where a function can
only return a value.

Is This Answer Correct ?    20 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want to write some certification courses, so friends could you guide me? which certification is best and how to write exam and what tutorials need to be studied,what to do first, I am working on automation tool QTP 9.2

1594


Explain the checkpoint in qtp?

705


How QTP support all types of applications (platforms)?

4144


How to use Environment parameterization? Explain with an example.

1570


What is expert view in qtp?

687






what testplan contents and what test strategy contents,what is the diff b/w them

1734


Hi could some one explan what is the use of the function Defination generator, And how to use the function defination generator.. Explan with the example..

1436


Discuss the QTP Environment?

714


How to test fly out menu in qtp?

596


Which environments does qtp support?

750


what could go wrong with test automation?

1597


Hi Friends, Can anyone help me out in this one? In QTP, I am using Data Driver and want to parameterise multiple values (say 3 values ) for a field. How can I do it using Data Driver wizard? Plz mention it step-by-step. In the end after doing the needful, on opening the Data Driver window, how can I get number (i.e. 3) in the Parameterised column for that particualr value? Thanks a lot in advance.

1528


They asked by using qtp recording writing scripting

2168


Diff b/w test scenario's and test Procedures?

1727


Hello, Is there any way to send the test results in html format (or any other) by email using outlook after the test run ends? thank you in advance

1856