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
How do you create an update query?
What is cursor explain with example?
What is implicit cursor in pl sql?
Which operator is used in query for pattern matching?
What is difference between inner join and cross join?
Explain scalar functions in sql?
How do you write an index?
What is sqlerrd?
What is having clause in sql?
What is compound trigger?
Is truncate ddl or dml?
What is rank dense_rank and partition in sql?
Explain the rollback statement?
What is difference between hql and sql?
What is the difference between inner join and left join?