What is difference between function and procedure?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
What all challenges you have faced during automation and how you have resolved it?
1)what is the quality process in QTP? 2)how to add the .tsr file in qtp through scripting?
How can we make a shared object repository in QTP 9?
3 Answers Kanbay, Ordain Solutions,
whenever a scenario is recorded ever, it creates a object repository automatically (‘per action’ /local ). we do not need to make them individually…then why we need a shared object repository. How it will be practically utilized ?? your input will be highly appreciated..
Plze let me know how you can validate in the QTP that printed documents is correctly printed or not ie how we can do the validation that all the records or text are printed successfully in the printed document as per the application format requuired.
In website, protocol has been changed http:to https what you will do? tell me your approach?
where is the bitmap checkpoint be saved
Explain the difference between check point and output value?
Hi Friends, Im planning to do certifcation in mercury Automation Tool QTP.But I Didnt get any clear details regarding course syllabus, fees, where to approach, and which certification would be useful for the experienced testers? can any one send me the details?
Hi Friends,I hav Just finished QTP course.Can any body suggest me which is the best place to go and post resume(Ban,Chennai,Pune,Mumbai,NCR,Kolkata).I mean how r calls in these cities,the best one?
What is API?
How do we handle run-time errors?