how many quotes?

Поиск
Список
Период
Сортировка
От Franco Bruno Borghesi
Тема how many quotes?
Дата
Msg-id 1070381520.3788.12.camel@taz.oficina
обсуждение исходный текст
Ответы Re: how many quotes?
Список pgsql-general
I need a function to fetch the nextval of a sequence (it should do other things, but my problem is the nextval() call), like this:

CREATE OR REPLACE FUNCTION test() RETURNS INTEGER AS '
DECLARE
   val INTEGER;
BEGIN
   val:=SELECT nextval(''''''''''usuarios_seq'''''''''');
  
   --do other things
END;
' LANGUAGE 'plpgsql';

SELECT test();
ERROR:  syntax error at or near "SELECT" at character 8
CONTEXT:  PL/pgSQL function "test" line 4 at assignment

I can't figure out how many quotes I should use to call nextval. I've read an article at the techdocs about this, but didn't help me. If anyone knows the *magic* number, please tell me :)

thanks in advance.


Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Invalid page header in block
Следующее
От: "Jay O'Connor"
Дата:
Сообщение: Re: language war