What is difference between function and procedure?
Answers were Sorted based on User's Feedback
Answer / santosh(ssit)
Both functions and procedures can return values. Apart from
this following are the differences
1) Functions are used for computations where as procedures
can be used for performing business logic
2) Functions MUST return a value, procedures need not be.
3) You can have DML(insert,update, delete) statements in a
function. But, you cannot call such a function in a SQL query..
eg: suppose, if u have a function that is updating a table..
you can't call that function in any sql query.
- select myFunction(field) from sometable; will throw error.
4) Function parameters are always IN, no OUT is possible
5) Function returns 1 value only. procedure can return
multiple values(max. 1024)
6) Stored Procedure :supports deffered name resoultion
Example while writing a stored procedure that uses table
named tabl1 and tabl2 etc..but actually not exists in
database is allowed only in during creation but runtime
throws error Function wont support deffered name resolution.
Stored procedure returns always integer value by default
zero. where as function return type could be
scalar or table or table values(SQL Server).
Stored procedure is pre compiled exuction plan where as
functions are not.
7) A procedure may modifiy an object where a function can
only return a value.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / priya.
Procedures v/s functions.
1.A function MUST return a value. A procedure can also
return value, but it is NOT MANDATORY for Procedure to
return a value.
2.A function can return only ONE value. A procedure can
return MULTIPLE values.
3.A function can be used with SELECT statements as like as
other in-build functions. But, a procedure cannot be used
with SELECT statements.
4.A function cannot be executed directly from SQL prompt
using EXEC command, but it is possible to execute directly
from SQL prompt using EXEC command.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / priya
1.A function must return a value. A procedure can also
return value, but it is not mandatory for Procedure to
return a value.
2.A function can return only one value. A procedure can
return multiple values.
3.A function can be used with SELECT statements as like as
other in-build functions. But, a procedure cannot be used
with SELECT statements.
4.A function cannot be executed directly from SQL prompt
using EXEC command, but it is possible to execute directly
from SQL prompt using EXEC command.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / savi
1.fumction should return a value
procedure may or not return a value
2.function computes a value
procedure performs an action
Is This Answer Correct ? | 1 Yes | 3 No |
1.Function always return a single value but procedure may
return more than one value.
2.We can use functions in select statement but we can not
use procedure in select statement.
3.There is possible of recurssive functionlike max(min
(something)),but there is nothing like in procedure.
4.In function we use a return keyword but in procedure no
return keyword is used.
Is This Answer Correct ? | 8 Yes | 11 No |
Answer / abhishek khare
1.Funcan can return a valur but not procedure
2.Function can accept only one parameter IN but procedure
can take IN or OUT or both parameters.
3.Procedure follows only linear execution but not function.
Is This Answer Correct ? | 13 Yes | 36 No |
Answer / siva
Fuction returns a value whereas procedure doesnt return any
value
if some function calling is dere den function switch over 2
d function definition part directly but procedure go from
top 2 down linearly
Is This Answer Correct ? | 25 Yes | 82 No |
Answer / deepika
Action is a part of Function.
Function is a Like a Functional Test case.
Procedure is a process to perform the Different Actions
Is This Answer Correct ? | 71 Yes | 136 No |
What are the problems / difficulties faced when you used Smart Identification ?
1.can we parameterise object repository?how we can do it? 2.there is a name "mallikharjun".i want to get the vowels in it through VBSCRIPT?
Why qtp the best testing tool?
How to do Laod testing for web based Application?
hi guys this is Keerthi, I am searching for job,so I want to know which questions are intervier asking on QTP&MANUAL&QUALITY CENTER,can u send Any one questions&Answers to my id:chinna.ammi@yahoo.co.in
I have faced one issues while doing test in QTP. I have described the scenario below. 1. I have to test web application.In that i want to give input of drop down values in the application. 2. Suppose Drop down has 5 value "A,B,C,D,E".I would like to give value from data table of QTP. 3. I have changed the drop down value as variable in Keyword view and given values in data table "A,B,C,D,E" as one below one. 4. While i am running the script it could not identify the drop down value which is in Data Table.It shows message. How to make value identify by QTP?
Why you have to add the specific add in in QTP? My answer is to recognize the specific objects we have to add the add-in in QTP...but he asked again after adding addin how qtp recognize the objects successfully? what is there in the add-in ?
Can we directly start working with QTP without any knowledge on WinRunner? (After getting trsining on QTP)
How to connect the remote desktop using QTP 9.2 explain the method or procedure?
0 Answers Magna Infotech, Oracle,
What is parameterization? What is syncronization pt.?
3 Answers Semantic Space, SRM,
1.How do u prepare the test suits in QC? 2.How do u convert requirements to test plan in QC?
Hi all , I am new at QTP I want a sample script to check validation messages(For java script or VB script) for login page with for web based application.. Any one can Help. I have to complete it in two days I need urgent help.. Ex. if I want to check mail.yahoo.com 1 > If user doed not exist it display "Username does not exist" 2> if invalid Uname and password then it display" Invalid Uname or pass" 3> Loing Sucssessfully. I want to check this types of application by using data table to give values of username and password.. Thanks