PostgreSQL sequence within function

From: Clark Allan <clarka(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: PostgreSQL sequence within function
Date: 2005-06-30 19:03:06
Message-ID: 4a7a732105063012037cf8dc1e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am new to Postgre, and am still learning some of the basics...
please bare with me.

I need to know how to access a sequence from within a function. Let me
know whats wrong with the following...

(this is not the exact function, just for examples sake...)
----------------------------------------------
CREATE FUNCTION getSeq()
RETURNS int AS'
RETURN nextval('myseq')
'LANGUAGE 'plpgsql';
----------------------------------------------

Thanks for the help
Clark

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tony Caduto 2005-06-30 19:27:03 Re: COnsidering a move away from Postgres
Previous Message Vivek Khera 2005-06-30 18:32:37 Re: Error while installing Slony 1.1.0 for PostGreSql version 7.3.4