pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedquestion about PL/pgSQL function
3+ messages / 3 participants
[nested] [flat]
* question about PL/pgSQL function
@ 2001-05-31 11:24 datactrl <quals@bigfoot.com>
2001-06-01 16:24 ` Re: question about PL/pgSQL function Josh Berkus <josh@agliodbs.com>
0 siblings, 1 reply; 3+ messages in thread
From: datactrl @ 2001-05-31 11:24 UTC (permalink / raw)
To: pgsql-sql
With postgres 7.1
1. Function like example found on 24.4 Example in Programmer Guide
CREATE FUNCTION xxx (EMP, integer) RETURNS boolean AS'......
(which EMP is a table )
How do I pass a record to this function in PL/PGSQL? I try this
....
select into rec1 * from EMP where empNo =''xxxx'';
i1 := xxx(rec1,5);
....
But it won't work!
2. Is that possible to return a record from a function? And how do I get the
returned record in PL/pgSql
JACK
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: question about PL/pgSQL function
2001-05-31 11:24 question about PL/pgSQL function datactrl <quals@bigfoot.com>
@ 2001-06-01 16:24 ` Josh Berkus <josh@agliodbs.com>
2001-06-01 19:29 ` Re: question about PL/pgSQL function Jan Wieck <JanWieck@Yahoo.com>
0 siblings, 1 reply; 3+ messages in thread
From: Josh Berkus @ 2001-06-01 16:24 UTC (permalink / raw)
To: datactrl <quals@bigfoot.com>; pgsql-sql
Jack,
> select into rec1 * from EMP where empNo =''xxxx'';
> i1 := xxx(rec1,5);
Bad syntax. The correct syntax is:
SELECT * INTO rec1 FROM EMP WHERE empNo=''xxxx'';
> 2. Is that possible to return a record from a function? And how do I
> get the
> returned record in PL/pgSql
No, it is not possible. I know the list archives are kinda hard to
search, but we've discussed this question ad naseum; in fact, I just
provided a workaround earlier this week.
-Josh
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: question about PL/pgSQL function
2001-05-31 11:24 question about PL/pgSQL function datactrl <quals@bigfoot.com>
2001-06-01 16:24 ` Re: question about PL/pgSQL function Josh Berkus <josh@agliodbs.com>
@ 2001-06-01 19:29 ` Jan Wieck <JanWieck@Yahoo.com>
0 siblings, 0 replies; 3+ messages in thread
From: Jan Wieck @ 2001-06-01 19:29 UTC (permalink / raw)
To: Josh Berkus <josh@agliodbs.com>; +Cc: datactrl <quals@bigfoot.com>; pgsql-sql
Josh Berkus wrote:
> Jack,
>
> > select into rec1 * from EMP where empNo =''xxxx'';
> > i1 := xxx(rec1,5);
>
> Bad syntax. The correct syntax is:
>
> SELECT * INTO rec1 FROM EMP WHERE empNo=''xxxx'';
>
> > 2. Is that possible to return a record from a function? And how do I
> > get the
> > returned record in PL/pgSql
>
> No, it is not possible. I know the list archives are kinda hard to
> search, but we've discussed this question ad naseum; in fact, I just
> provided a workaround earlier this week.
Not yet. In the current 7.2 development tree it's possible to
return a cursor opened inside of the procedure. Maybe I can
even improve it so you can open an empty cursor and *fill* it
like a tuple sink so to speak. Mainly depends on if and how
we want to improve the capabilities of portals.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-06-01 19:29 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-05-31 11:24 question about PL/pgSQL function datactrl <quals@bigfoot.com>
2001-06-01 16:24 ` Josh Berkus <josh@agliodbs.com>
2001-06-01 19:29 ` Jan Wieck <JanWieck@Yahoo.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox