| От | George Wadsworth |
|---|---|
| Тема | using variable in nextval |
| Дата | |
| Msg-id | 374DE6DC.E8D30DD@agritope.com обсуждение исходный текст |
| Список | pgsql-sql |
Hi! I'm trying to use a variable as the sequence name in a nextval: using pgsql 6.4.2, PL/pgSQL called from a trigger -- site is a char() used to describe the location -- generation is an int used for generations of plants -- each site/generation combo has it's own sequence site := new.site; gen := new.generation; sequencename := site || gen; newSerial := nextval(sequencename); I get ERROR: Only constant sequence names are acceptable for function 'nextval' I've tried all sorts of quote, double quotes, etc and this is the closest I've got. Does anyone know of a workaround? There are 12 different combinations and I don't really want to make a big, nasty, nested if... thanks in advance. -George Wadsworth
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера