| From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
|---|---|
| To: | yi huang <yi(dot)codeplayer(at)gmail(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: How to handle nested record data. |
| Date: | 2012-05-30 03:21:03 |
| Message-ID: | CAFj8pRDzZyMWifgocT82tikqLtrt9iu8qXj7jqK69cjNJ+2Nrg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Craig Ringer | 2012-05-30 03:55:01 | Re: Export and import from one postgres server to another |
| Previous Message | yi huang | 2012-05-30 03:11:30 | How to handle nested record data. |