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...

How to return more than one value from a function?

Answer Posted / murali

We can return more than one row using out parameter. Try
this with the following.

create or replace function my_func(myno number, myname out
varchar2) return number as
mysal emp.sal%type;
begin
select ename, sal into myname, mysal from emp where
empno=myno;
return sal;
end;

in the above example we are returning first value mysal
using return statement and second value myname using out
parameter.

Is This Answer Correct ?    11 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are predefined functions in sql?

976


What is mdf ldf and ndf?

929


Do stored procedures prevent sql injection?

915


What is a native sql query?

971


Which nosql database is best?

919


What is schema in sql example?

1085


Difference between global and parameter variables?

1905


When is the explicit cursor used ?

976


What is the benefit of foreign key?

960


What is the usage of the distinct keyword?

1165


How to combine two stored procedures in sql?

1118


what is msql? : Sql dba

939


Which are sql * plus commands?

1039


What is sql catalog?

961


What is embedded sql with example?

984