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

How do you create an update query?

962


What is cursor explain with example?

985


What is implicit cursor in pl sql?

1090


Which operator is used in query for pattern matching?

1089


What is difference between inner join and cross join?

969


Explain scalar functions in sql?

1066


How do you write an index?

965


What is sqlerrd?

968


What is having clause in sql?

963


What is compound trigger?

1036


Is truncate ddl or dml?

991


What is rank dense_rank and partition in sql?

1041


Explain the rollback statement?

1009


What is difference between hql and sql?

1077


What is the difference between inner join and left join?

989