Newbie ...Function error (Stored Procedure)?

From: zhi7c001(at)sneakemail(dot)com (Ron S)
To: pgsql-general(at)postgresql(dot)org
Subject: Newbie ...Function error (Stored Procedure)?
Date: 2001-08-27 19:34:14
Message-ID: 18069d11.0108271134.581892da@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a sequence called seq1.

In psql I am trying to create a function which simply calls this
sequence with the nextval() function.

CREATE FUNCTION testid()
RETURNS INTEGER
AS 'SELECT NEXTVAL('seq1');'
LANGUAGE 'SQL';

I get the following error....
ERROR: parser: parser error at or near "seq1"

I can call nextval('seq1') by itself with now error.

What am I doing wrong? I can't for the life of me figure this
seemingly simple
error out ;)

Postgresql 7.0.3 on Mandrake 8.0

Thanks,
Ron

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arne Weiner 2001-08-27 21:44:15 Re: Newbie ...Function error (Stored Procedure)?
Previous Message Josh Voils 2001-08-27 18:40:43 Indexes and Timestamp Comparisons