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

From Tony Caduto
Subject Re: PostgreSQL sequence within function
Date
Msg-id 42CB07DC.3040009@amsoftwaredesign.com
Whole thread Raw
In response to PostgreSQL sequence within function  (Clark Allan <clarka@gmail.com>)
Responses Re: PostgreSQL sequence within function
List pgsql-general
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: SCassidy@overlandstorage.com
Date:
Subject: Re: double entries into database when using IE
Next
From: "Otto Blomqvist"
Date:
Subject: Custom C function shutdown-signaling