Results 1 to 3 of 3

Thread: Can Functions Return more than 1 value

  1. #1
    Geek_Guest
    Guest

    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.


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    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.


  3. #3

    Re: Can Functions Return more than 1 value

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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact