Search Postgresql Archives

Re: PostgreSQL sequence within function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux