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

What are the flaws in water fall model and how to overcome it?

549


Can any suggest me what is exposure testing?

1363


How to create Reusable and Multiple Actions?

1689


What are the types of properties that quick test learns while recording?

516


Explain the check points in quicktest professional (qtp)?

546






How to change the priorities of the recovery scenario properties?

580


Hi I know two types of testing processes. 1. Reaquirments stage,test design,code review's, Design review's, Test Plan, Test Cases design, test execution, Defect Reporting and tracking, UAT, Signoff. 2.Test Initiation , Test Plan, Test Design, Execution,Bug tracking, UAT, Sign off.

1358


Define object spy ?

549


Hi all, I am using windows vista, I am in the process of learning QTP. When ever I try to work with insert mode in flight application , i am getting the error of 'Operation must use an update table query, fractional truncation(null) error. Can anyone help me regarding this?

1383


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

1730


I want to do QTP Certification what is the pattern of Question paper.

1730


Brief the process of testing with UFT?

609


Define Environment Variable in UFT and its uses?

592


How to call a test from another test?

666


Consider one application is open, clicking one menu will open another application in another browser. QTP does not catch the URL of the second browser(second application). can we capture it ?

1460