can we have more than one RETURN statement in a function in PL/SQL ??
I know that we can have two RETURN statements in the following format:
if(condition) then
return .. ;
else
return.. ;
end if;
but that is not the actual answer. Please help.
Printable View
can we have more than one RETURN statement in a function in PL/SQL ??
I know that we can have two RETURN statements in the following format:
if(condition) then
return .. ;
else
return.. ;
end if;
but that is not the actual answer. Please help.
Fuction returns only one value. To return amount of data at a time use
oracle pipelined functions
[QUOTE=pritz.jobs;27597]can we have more than one RETURN statement in a function in PL/SQL ??
I know that we can have two RETURN statements in the following format:
if(condition) then
return .. ;
else
return.. ;
end if;
but that is not the actual answer. Please help.[/QUOTE]
You may write any number of return statements in a function but depending upon the codition it returns only one value. The RETURN statement immediately completes the execution of a subprogram and returns control to the caller.
You can specify as many number of return statements , but only one out of those will execute depending on the condition.