Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Posts
    14

    Arrow Unanswered: plpgsql function returns more values

    Hi,

    I am new to this postgreSQL . I am migrating one procedure from Oracle PL/SQL to plpgsql .I had 10 input parameters and 5 output parameters for the pl/sql Procedure...

    Please suggent me how can i convert the procedure to plsql procedure..
    Please note that..all my output parameters are different types...
    1) integer
    2) varchar
    3) timestamp
    4)varchar
    5)varchar

    my oracle PL/SQL procedure like this:

    create or replace procedure abc(a in varchar,b in integer....10 in parameters
    and a1 out integer
    a2 out varchar
    a3 out timestamp
    a4 out varchar
    a5 out varchar)

    because there r no Procedures in pgplsql ,I am creating Function for that.
    so please tell me the solution...

  2. #2
    Join Date
    Oct 2003
    Location
    slovakia
    Posts
    3

    Smile Re: plpgsql function returns more values

    Hi,

    make function with return type varchar;
    returning all the values, put them here delimitered ;(
    with some character....
    Receiving the value --> parse and convert....

    or use separate function for each return value...

    I think this is the only way.

    If somone knows another solution,
    I would like to know it :-)

  3. #3
    Join Date
    Aug 2003
    Posts
    14

    Re: plpgsql function returns more values

    [QUOTE][SIZE=1]Originally posted by radoslav
    Hi,

    Thanks for sending Reply.
    This is the Way what i am doing till now. But I think it's not Properway to do .

    Any thing Else?

  4. #4
    Join Date
    Oct 2003
    Location
    Czechrepublic
    Posts
    1

    Smile Re: plpgsql function returns more values

    You have to use own type

    CREATE TYPE mytype(a int, b text)

    create or replace function foo() returns mytype as '
    declare a mytype;
    begin
    a.a = 10;
    a.b = ''kuku'';
    return a;
    end' language plpgsql;

  5. #5
    Join Date
    Sep 2003
    Location
    Roma
    Posts
    19
    use an array ?
    --
    Frank "Pazzooo" Contrepois

Posting Permissions

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