pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
SQL FUNCTION return type on INSERT
3+ messages / 2 participants
[nested] [flat]

* SQL FUNCTION return type on INSERT
@ 2001-11-03 12:18  Edward Grabczewski <edward.grabczewski@btinternet.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Edward Grabczewski @ 2001-11-03 12:18 UTC (permalink / raw)
  To: pgsql-sql

What value should I RETURN for a SQL FUNCTION that contains an INSERT
statement?

--
Eddy Grabczewski
edward.grabczewski@btinternet.com






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: SQL FUNCTION return type on INSERT
@ 2001-11-03 14:12  Edward Grabczewski <edward.grabczewski@btinternet.com>
  parent: Edward Grabczewski <edward.grabczewski@btinternet.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Edward Grabczewski @ 2001-11-03 14:12 UTC (permalink / raw)
  To: pgsql-sql

I've just looked at the new online 7.2 documentation and found that all
functions must end in some kind of select.
How about this then?

CREATE FUNCTION foo(varchar)
RETURN unknown
AS '
      INSERT INTO footable VALUES ($1);
      SELECT null; '
LANGUAGE 'sql';

"Edward Grabczewski" <edward.grabczewski@btinternet.com> wrote in message
news:9s0n0p$1saj$1@news.tht.net...
> What value should I RETURN for a SQL FUNCTION that contains an INSERT
> statement?
>
> --
> Eddy Grabczewski
> edward.grabczewski@btinternet.com
>
>
>





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: SQL FUNCTION return type on INSERT
@ 2001-11-04 01:39  Josh Berkus <josh@agliodbs.com>
  parent: Edward Grabczewski <edward.grabczewski@btinternet.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Josh Berkus @ 2001-11-04 01:39 UTC (permalink / raw)
  To: Edward Grabczewski <edward.grabczewski@btinternet.com>; pgsql-sql

Eddy,

> What value should I RETURN for a SQL FUNCTION that contains an INSERT
> statement?

OPAQUE.

-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


end of thread, other threads:[~2001-11-04 01:39 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-11-03 12:18 SQL FUNCTION return type on INSERT Edward Grabczewski <edward.grabczewski@btinternet.com>
2001-11-03 14:12 ` Edward Grabczewski <edward.grabczewski@btinternet.com>
2001-11-04 01:39 ` Josh Berkus <josh@agliodbs.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