From: | yi huang <yi(dot)codeplayer(at)gmail(dot)com> |
---|---|
To: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: How to handle nested record data. |
Date: | 2012-05-30 04:37:59 |
Message-ID: | CAHU7rYbtoE4CEshbNqy5dxecOoNB2dHcu2HqKGuE3h6SZrvovg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, May 30, 2012 at 12:36 PM, yi huang <yi(dot)codeplayer(at)gmail(dot)com> wrote:
> Thanks for you quick reply, but i need to take this returned row in
> another pgsql function and do further processing.
Sorry, i was misunderstood, i get it now, just use a record type, thanks
very much.
>
>
> On Wed, May 30, 2012 at 11:21 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>wrote:
>
>> Hello
>>
>> create or replace function call_foo()
>> returns void as $$
>> declare r record;
>> begin
>> r := foo('Hello');
>> raise notice ''% %', r.somerow, r.otherinfo;
>> end;
>> $$ language plpgsql;
>>
>> regards
>>
>> Pavel
>>
>> 2012/5/30 yi huang <yi(dot)codeplayer(at)gmail(dot)com>:
>> > I'm porting a oracle function to postgresql, which has signature like
>> this:
>> >
>> > FUNCTION foo
>> > ( seq IN varchar
>> > , somerow OUT SomeTable
>> > , otherinfo OUT varchar
>> > )
>> >
>> > It's easy to port this function itself to postgresql, but i have
>> problem to
>> > execute this function and assign the results into variables:
>> >
>> > SELECT (foo(seq)).* INTO (v_somerow, v_otherinfo);
>> >
>> > It complains v_somerow can not be row type.
>> >
>> > How to handle the result of function foo?
>> >
>> > Best regards.
>> > YiHuang.
>>
>
>
>
> --
> http://yi-programmer.com/
>
From | Date | Subject | |
---|---|---|---|
Next Message | yi huang | 2012-05-30 05:03:54 | Re: How to handle nested record data. |
Previous Message | yi huang | 2012-05-30 04:36:23 | Re: How to handle nested record data. |