Geeks Talk

Prepare for your Next Interview




Can Functions Return more than 1 value

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....


Go Back   Geeks Talk > Databases > Oracle

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 04-18-2007
Expert Member
 
Join Date: Feb 2007
Posts: 1,279
Thanks: 0
Thanked 164 Times in 138 Posts
Geek_Guest is on a distinguished roadGeek_Guest is on a distinguished road
Can Functions Return more than 1 value

Question asked by visitor lalitendu bag

Can Functions Return more than 1 value? if yes then give an example.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-12-2007
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,432
Thanks: 8
Thanked 125 Times in 112 Posts
debasisdas will become famous soon enoughdebasisdas will become famous soon enough
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.
Reply With Quote
  #3 (permalink)  
Old 07-20-2007
Expert Member
 
Join Date: Jul 2007
Location: Kolkata
Posts: 110
Thanks: 6
Thanked 8 Times in 8 Posts
animesh.chatterjee is on a distinguished road
Re: Can Functions Return more than 1 value

yes it can return....
1=true
0=false
-1=any crash
Reply With Quote
Reply

  Geeks Talk > Databases > Oracle


Thread Tools
Display Modes


Similar Threads

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


All times are GMT -4. The time now is 01:04 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved