Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is Difference between StoredProcedure and function?

Answers were Sorted based on User's Feedback



What is Difference between StoredProcedure and function?..

Answer / shankar

FUNCTION always return a value where as PROCEDURE may or
may not return value.

Is This Answer Correct ?    3 Yes 1 No

What is Difference between StoredProcedure and function?..

Answer / ganesh sial

1. Function is mainly used in the case where it must
return a value. Where as a procedure may or may not return
a value or may return more than one value using the OUT
parameter.
Â
2. Function can be called from SQL statements where as
procedure can not be called from the sql statements

3. Functions are normally used for computations where as
procedures are normally used for executing business logic.

4. You can have DML (insert,update, delete) statements in a
function. But, you cannot call such a function in a SQL
query.

5. Function returns 1 value only. Procedure can return
multiple values (max 1024).

6.Stored Procedure: supports deferred name resolution.
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 deferred name
resolution.

7.Stored procedure returns always integer value by default
zero. where as function return type could be scalar or
table or table values

8. Stored procedure is precompiled execution plan where as
functions are not.
Â
9.A procedure may modify an object where a function can
only return a value The RETURN statement immediately
completes the execution of a subprogram and returns control
to the caller.
2. Function -
1) Have to return a single value to the calling program
2) Can call functions in sql statements
3) Cannot return images
.


Procedures -
1) Do not return any value except assigning values to OUT
variables
2) Cannot call procedures in sql statements
3) Can return images

Is This Answer Correct ?    1 Yes 0 No

What is Difference between StoredProcedure and function?..

Answer / prabhu karanam

We can use a function in the select query, but Procedure we
can't use in select query. But the function created with out
parameter, we can't use in select statement. Only in
parameter, we can use.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More SQL PLSQL Interview Questions

What is a trigger in sql?

0 Answers  


What is the difference between inner join and outer join?

0 Answers  


what is the difference between inner and outer join? Explain with example. : Sql dba

0 Answers  


Is join same as left join?

0 Answers  


What are the different types of joins and explain them briefly.

3 Answers  


what is the forward decleration in packages?

1 Answers  


What does desc stand for?

0 Answers  


What is mutating table?

11 Answers   Saama Tech,


how can stop the sequence with mention the max value and with out mention the max value

1 Answers   Zensar,


Hi All, I am new to both this blog and technology. I was able to see a response for one of the questions on triggers as below. I would like to know why are we using " if rtrim(to_char(sysdate,'day'))=rtrim('sunday') then" instead, can't we use " if sysdate = 'sunday' then". I can understand the use of "rtrim", but dont know y v r using to_char. I have seen this in many cases but did not get a convincible explaination. Please help me with this and do excuse if this question sounds silly. Thanks in advance...... create or replace trigger trg_sun before insert on <table name> begin if rtrim(to_char(sysdate,'day'))=rtrim('sunday') then raise_application_error(-20345,'no transaction in sunday'); end if; end trg_sun;

2 Answers  


What is dml with example?

0 Answers  


how to check myisam tables for errors? : Sql dba

0 Answers  


Categories