Prepare for your Next Interview
This is a discussion on Can Functions Return more than 1 value within the Oracle forums, part of the Databases category; Question asked by visitor lalitendu bag Can Functions Return more than 1 value? if yes then give an example....
|
|||
|
Re: Can Functions Return more than 1 value
Using the RETURN clause, function can return only one variable. The variable can be of any data type - Number, VARCHAR, REF CURSOR, PL/SQL Table and many more. If the function is returning a data structure like PL/SQL Table, REF CURSOR etc, it is returning more than one value.
Another way of returning values is using OUT parameters. And this applies to both Procedures and Functions. Using OUT parameters, you can return as many values as you need. If you have a need for OUT parameters, though, you would generally want a procedure, not a function. A function with OUT parameters cannot be called from a SQL statement, which rather defeats the purpose of using a function. Function can able to return more than one value using ref cursur... but that is not recomended. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Return Value of Functions | janelyn | C and C++ | 3 | 09-24-2007 02:09 AM |
| Can void be the return value of main Function | joel | C and C++ | 3 | 09-10-2007 02:21 AM |
| return clause in cursor | Barbie | Oracle | 4 | 01-31-2007 05:46 AM |
| The Return Of Kalayama! | kalayama | Get Together | 3 | 01-14-2007 03:17 AM |
| What is the Return Value | RajivPrasad | ASP.NET | 1 | 10-09-2006 04:17 PM |