From: | Jie Liang <jliang(at)ipinc(dot)com> |
---|---|
To: | John Taves <jtaves(at)pickatime(dot)com> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Can a function return a record set? |
Date: | 2001-02-23 03:33:18 |
Message-ID: | Pine.BSF.4.10.10102221930340.83201-100000@tidal.ipinc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
in plpgsql
you've to use
select field into a_variable from table where ...(single value return)
or
for record|row in select fields from table loop
...
end loop;
Jie LIANG
St. Bernard Software
Internet Products Inc.
10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873
jliang(at)ipinc(dot)com
www.stbernard.com
www.ipinc.com
On Sat, 17 Feb 2001, John Taves wrote:
> Am I correct in concluding that I can't return a record set from a function?
>
> For example, in MS SQL I would do:
>
> create procedure foo as
> select * from yada
>
> I expected to be able to do the following in postgresql.
>
> create function foo (integer) returns (integer) as '
> begin
> select * from yada;
> end; '
> language 'plpgsql';
>
> I am concluding that I can't.
>
> jt
>
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Jie Liang | 2001-02-23 03:39:17 | Re: Trouble with CREATE FUNCTION |
Previous Message | Ross J. Reedstrom | 2001-02-22 23:18:06 | Re: Strange parse error?? |