Results 1 to 8 of 8

Thread: return 2 values

  1. #1
    Join Date
    Nov 2003
    Posts
    53

    Unanswered: return 2 values

    hi i wish to ask, what can i use to return 2 value? i mean, actually i'm executing a function, and the function is supposed to return 2 values. but a function can only return 1 value? is there any way to solve this? or i have to seperate the funtion?

  2. #2
    Join Date
    Jan 2004
    Location
    North Haven, CT
    Posts
    110

    Re: return 2 values

    Originally posted by Daven81
    hi i wish to ask, what can i use to return 2 value? i mean, actually i'm executing a function, and the function is supposed to return 2 values. but a function can only return 1 value? is there any way to solve this? or i have to seperate the funtion?
    1. use out parameter like
    create procedure/function xxx(p_in in number, p_out1 out number, p_out2 out number)...

    2. return record type.

  3. #3
    Join Date
    Jan 2004
    Location
    India
    Posts
    191

    Re: return 2 values

    Its better to convert ur function into procedure
    Pagnint
    (No need to search web before posting new question)

  4. #4
    Join Date
    Nov 2003
    Posts
    53
    procedure? but i wanna return values, isnt procedure unable to return values...

  5. #5
    Join Date
    Nov 2003
    Posts
    53
    please can someone give me any link/url? coz i cant find anything on the net!

  6. #6
    Join Date
    Nov 2003
    Posts
    53
    need help! i wanna use stored procedures, and i cant solve this as i got error. maybe is my declaration of the procedure in the package is not correct. pls help

    package:
    PROCEDURE GET_SHIFT_TIME(
    VStart in STAGE.FISC_DAY%TYPE,
    VEnd in STAGE.FISC_DAY%TYPE,
    final_last_shift out varchar2);

  7. #7
    Join Date
    Feb 2004
    Posts
    5

    Talking

    As I am in a good mood...

    For instance:

    create or replace procedure hello_world
    ( abcd out varchar2
    , efgh out varchar2
    ) as
    begin
    abcd := 'Hello';
    efgh := 'World';
    end;
    /

    Then try:

    set serveroutput on
    begin
    declare
    ijkl varchar2(10);
    mnop varchar2(10);
    begin
    hello_world(ijkl, mnop);
    dbms_output.put_line(ijkl);
    dbms_output.put_line(mnop);
    end;
    end;
    /

    Both from SQL*Plus

  8. #8
    Join Date
    Nov 2003
    Posts
    53
    thanks finally got it! hope u r always in good mood!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •