| От | A. Kretschmer |
|---|---|
| Тема | Re: Using a variable in sql in a function |
| Дата | |
| Msg-id | 20100105145350.GC16421@a-kretschmer.de обсуждение |
| Ответ на | Using a variable in sql in a function (Peter Jackson <mltasmaniac@tasjackson.com>) |
| Список | pgsql-novice |
In response to Peter Jackson : > Hiya list, > > I was wondering if this is possible or not. If yes how? > > I want to use a changing where condition on the query, subject to the > value I pass in to the function. I have tried the below but it fails in > use. This is with PostgreSql 8.3.1. You can do that, but you need to build a complete string containing your full query and execute this string. http://www.postgresql.org/docs/current/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431 2EB0 389D 1DC2 3172 0C99
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера