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
What are predefined functions in sql?
What is mdf ldf and ndf?
Do stored procedures prevent sql injection?
What is a native sql query?
Which nosql database is best?
What is schema in sql example?
Difference between global and parameter variables?
When is the explicit cursor used ?
What is the benefit of foreign key?
What is the usage of the distinct keyword?
How to combine two stored procedures in sql?
what is msql? : Sql dba
Which are sql * plus commands?
What is sql catalog?
What is embedded sql with example?