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

Mention what does the hierarchical profiler does?

726


What is a scalar value in sql?

797


What is the advantage of index in sql?

682


what are the different index configurations a table can have? : Sql dba

739


Explain the uses of control file.

771






What is the maximum rows in csv?

643


What does where 1/2 mean in sql?

750


Define union, minus, union all, intersect ?

734


what is 'mysqladmin' in mysql? : Sql dba

739


How do I make my sql query run faster?

658


What is bulk collect in pl sql?

721


can a stored procedure call itself or recursive stored procedure? How much level sp nesting is possible? : Sql dba

757


State few characteristics of pl/sql?

720


What is the use of index in sql?

758


Explain correlated query work?

787