What is difference between function and procedure?

Answers were Sorted based on User's Feedback



What is difference between function and procedure?..

Answer / rajasekhar

Procedure is used for performing a specific task any number of times in different situations,thats why it is defined as a block of reusable statements to perform a specific task..

There are 2 types of procedures
1. Function procedures
2. Sub procedures

Function procedure can return a value
Sub procedure cannot return a value


Sub procedures execute more faster than function procedures

Is This Answer Correct ?    0 Yes 0 No

What is difference between function and procedure?..

Answer / kamal pratap singh

Difference between Functions and Stored Procedure:
1. Function always return value, but procedure may return
value or not.
2. Function return only one value, but procedure return one
value or more than one value.
3. In Function, we can insert a value through parameter
passing like IN. but in procedure, we can insert value using
IN or get a value using OUT or both insert and get value
through single parameter using INOUT.
4. Function are used to perform computation, but procedures
are used to perform business logic.
5. Function are needed to compile when they are called, but
procedures are compiled only one time, so procedures are no
need to compile again. Because the procedure are in pre
compiled format.
6. Function can be called with SQL query but procedure can
not be used with SQl query.

Is This Answer Correct ?    0 Yes 0 No

What is difference between function and procedure?..

Answer / archana das

1> A function can only return a value ,but procedure return
multiple values (max 1024).
2> A function is normally used for computations whereas a
procedure is used for executing business logic.

Is This Answer Correct ?    0 Yes 0 No

What is difference between function and procedure?..

Answer / d.sharath kumar

function must reaturn a value
procedure ned not be



function can take only input value,but
procedure may take both input & out put parameter

Is This Answer Correct ?    0 Yes 0 No

What is difference between function and procedure?..

Answer / rohan

1)FUNCTION doesn't have wait statement WHERE PROCEDURE may
have wait statement..!

2)IN FUNCTION all parameters are Mode "IN" WHERE PROCEDURE
MODE may be IN,OUT,INOUT.

3)Generalize form of an expression (FUNCTION)
PROCEDURE-Generalize Form of Statsment.

Is This Answer Correct ?    0 Yes 0 No

What is difference between function and procedure?..

Answer / veera

1) Stored procedure are compiled for first time and compiled
format is saved and executes compiled code when ever it is
called. But function is compiled and executed every time it
is called.

2) Function must return a value but in stored procedure it
is optional.

3) Function takes one input parameter it is mandatory but
stored procedure may take o to n input parameters.

4) Functions can be called from select statement, but stored
procedures can not be called from select statement.

5) We can build logic in functions and we can even break
complex logic in to methods.

6) We can use try catch statements in stored procedures but
in functions we can not use.

7) We can not use insert,delete,update and create statements
in functions but in stored procedures we can use those
statements.

8 ) Functions can have only input parameters but stored
procedure can have input and out put parameters


Thanks and Regards,
VEERA

Is This Answer Correct ?    0 Yes 0 No

What is difference between function and procedure?..

Answer / sateesh reddy

Function must contain a return clause in the header.
Procedure do not contain a return clause in the header.

Is This Answer Correct ?    0 Yes 0 No

What is difference between function and procedure?..

Answer / sudipta kumar dhal

1.Function is a subprogram that returns a value.

2.Procedure is a subprogram that performs a specific action.


3. Function can return only one value but procedure can return

more than one, or may not return any value.

4. Function can be called from sql statements where as

procedure cannot be called from the sql statements.

5. We can use functions in select statement but we can not use

procedure in select

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

7.You can have DDL(create,alter,drop) statements in a

procedure.

Is This Answer Correct ?    0 Yes 0 No

What is difference between function and procedure?..

Answer / ankit kakadiya

correct

Is This Answer Correct ?    0 Yes 0 No

What is difference between function and procedure?..

Answer / santosh(ssit)

1. Function returns 1 value only. Procedure can return
multiple values.
2. Function can be called from SQL statements where as
procedure can not be called from the sql statements .

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

There is a very good institute for Automation Testing using QTP.For more details please visit jbslearnings.com.

1 Answers  


What is qtp window?

0 Answers  


When should u feel that u can stop testing now? The following are few of the common Test Stop criteria:

2 Answers  


What are the Application Functions available in QTP?

0 Answers  


what is delay in QTP?

2 Answers  






what is meant by automation tool?

1 Answers  


How to find Operating system information using QTP script?

0 Answers  


In an interview, what r the general questions asked in QTP? pls give me anwser to this question?

0 Answers  


what are the functions availabla in QTP? what are the data types in QTP?

2 Answers   Spry Technologies,


what is the use of VIRTUAL OBJECTS? explain ?

10 Answers   ABC Infotech, IBM, TCS,


how to invoke the web application through script in qtp

8 Answers   Synechron,


where u maintain qtp scripts in ur company

4 Answers   HCL,


Categories