| От | Sigurdur Helgason |
|---|---|
| Тема | How to dynamically call a column in plpgsql |
| Дата | |
| Msg-id | 20021028083010.96614.qmail@web41009.mail.yahoo.com обсуждение |
| Список | pgsql-novice |
Hi! I am trying to fetch a value from a column, where the columnname is a value in another column. See below .. table constraint_1 ( ... cons_col VARCHAR(15) NOT NULL, ... ) Then in the trigger (written in plpgsql) I want to fetch the appropriate column from the NEW record. --- trigger -- bla bla bla... select cons_col from constraint_1 where bla = bla ... -- the_val := NEW.cons_col; bla. bla .bla. return NEW; bla bla bla.. ---- Well I have tried a couple different things .. none seem to work. I know that this is possible if the trigger is written in C .. but it might be nice to know how to do this in plpgsql. Anyone out there that knows how to do this? _____________________________________________________ Gratis e-mail resten av livet på www.yahoo.se/mail Busenkelt!
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера