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

.have you ever written compiled module? if yes , tell me about some of the function that you wrote.

1684


How to capture all the data of a webtable, weblist and combolist using QTP?

2857


What is the registration process and examination fees?

559


what are the mandatory properties for a tex boxc (scenario?)

1531


How to build scripts that access data from external sources?

1614






How to import a test case present in ".xls" file to TD under a Test set?

755


What is a quick test professional?

638


How does you pass optional arguments in qtp?

565


Can we access the java methods in qtp. Because my requirement is to access the swt(for eclipse an it is java code) methods in qtp is it possible?

1528


Hi Friends this is kumar i would like to request to all of you ,please help me to explain real time project with using qtp scripts i know basics of qtp but it won't workout on interviews,pls help awating to reply.

1379


What is Test Fusion Report in QTP?

624


regular expression in qtp standar check point for months from accepting months from january to december only

1483


diff between qtp versions from 8.5

1573


HOW AUTOMATE TEST SCRIPT ? what time it will do? after gneration of basic script or Any , Plz explain detailed?

1720


Hi All, How to get repeated word in string . Thanks Balaji

943