Newbie ...Function error (Stored Procedure)?

Поиск
Список
Период
Сортировка
От zhi7c001@sneakemail.com (Ron S)
Тема Newbie ...Function error (Stored Procedure)?
Дата
Msg-id 18069d11.0108271134.581892da@posting.google.com
обсуждение исходный текст
Ответы Re: Newbie ...Function error (Stored Procedure)?  (Richard Poole <richard.poole@vi.net>)
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Israel Evans
Дата:
Сообщение: PostgreSQL On the Mac? OS9 or OSX?
Следующее
От: "Corn"
Дата:
Сообщение: Questions about unicode.