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 is the difference between join and natural join?
What are the conditions an underlying table must satisfy before a cursor can be used by a positioned update or delete statement? : Transact sql
What is the difference between delete, truncate and drop command?
Can we write dml inside a function in sql server?
how would concatenate strings in mysql? : Sql dba
What does (*) mean in sql?
What programs use sql?
Mention what is the use of function "module procedure" in pl/sql?
What are the types of optimization?
How to start oracle sql developer?
Which one is better sql or oracle?
Is primary key clustered or nonclustered?
how to load data files into tables with 'mysqlimport'? : Sql dba
How much does sql certification cost?
How many types of triggers exist in pl/sql?