| От | Richard Huxton |
|---|---|
| Тема | Re: Question about functions |
| Дата | |
| Msg-id | 43535E2D.8080500@archonet.com обсуждение исходный текст |
| Ответ на | Question about functions (Mike Plemmons <mikeplemmons@gmail.com>) |
| Список | pgsql-sql |
Mike Plemmons wrote: > I am trying to run this function but the return is not correct. If I run the > select statement from the psql command line it works. My guess is that the > WHERE clause could be causing the problem. Then again, it may be how I am > using the FOR loop. The ides column is of type TEXT. > FOR myrec IN SELECT * FROM tblStuff WHERE ides LIKE '%$1%' LOOP You're assuming plpgsql does variable interpolation in a similar way to Perl/shell etc. It doesn't. You'll want something like: ...LIKE '%' || $1 || '%' -- Richard Huxton Archonet Ltd
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера