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 many types of primary keys are there?
Explain cursor types?
what is the difference between primary key and unique key? : Sql dba
How to use sql*plus built-in timers?
what is uncommittable transactions? : Transact sql
How do we accept inputs from user during runtime?
What is difference between db2 and sql?
Is record in oracle pl sql?
What is assignment operator in pl sql?
Explain raise_application_error.
How do you create a db file?
What is normalisation and its types?
What are different methods to trace the pl/sql code?
what is a table called, if it has neither cluster nor non-cluster index? What is it used for? : Sql dba
What is meant by cursor in sql?