Re: SQL FUNCTION return type on INSERT

From: "Edward Grabczewski" <edward(dot)grabczewski(at)btinternet(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: SQL FUNCTION return type on INSERT
Date: 2001-11-03 14:12:36
Message-ID: 9s0tnd$1tbd$1@news.tht.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)grabczewski(at)btinternet(dot)com> wrote in message
news:9s0n0p$1saj$1(at)news(dot)tht(dot)net(dot)(dot)(dot)
> What value should I RETURN for a SQL FUNCTION that contains an INSERT
> statement?
>
> --
> Eddy Grabczewski
> edward(dot)grabczewski(at)btinternet(dot)com
>
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Edward Grabczewski 2001-11-03 14:17:19 Re: PL/pgSQL syntax for strings
Previous Message Edward Grabczewski 2001-11-03 12:18:06 SQL FUNCTION return type on INSERT