Re: PostgreSQL sequence within function - Mailing list pgsql-general

From Clark Allan
Subject Re: PostgreSQL sequence within function
Date
Msg-id 4a7a73210507051605e424648@mail.gmail.com
Whole thread Raw
In response to Re: PostgreSQL sequence within function  (Tony Caduto <tony_caduto@amsoftwaredesign.com>)
List pgsql-general
ahhh... very nice. Thank you.

On 7/5/05, Tony Caduto <tony_caduto@amsoftwaredesign.com> wrote:
Or upgrade your server to 8.x and use dollar quoting.
with dollar quoting all that is a thing of the past.

CREATE FUNCTION sp_slide_create(int4) RETURNS int4 AS
$$
DECLARE
aScriptID ALIAS FOR $1;
seqID int4 := nextval('genseq'); -- no magic needed with dollar qouting :-)
BEGIN

INSERT INTO tblslides (slideid) VALUES (seqID);

RETURN seqID;

END;
$$
LANGUAGE 'plpgsql' VOLATILE


pgsql-general by date:

Previous
From: "Otto Blomqvist"
Date:
Subject: Custom C function shutdown-signaling
Next
From: Tom Lane
Date:
Subject: Re: Custom C function shutdown-signaling