| От | Richard Huxton |
|---|---|
| Тема | Re: Problem with returning setof record |
| Дата | |
| Msg-id | 413DF177.1060407@archonet.com обсуждение исходный текст |
| Ответ на | Problem with returning setof record (oliverp21@free.fr) |
| Список | pgsql-sql |
oliverp21@free.fr wrote: > Hello, > > Here is a simple function I created for a test. > > create function ttt() returns setof record as ' > When I try to use it, it returns to me : > > select ttt(); > set-valued function called in context that cannot accept a set > : PL/pgSQL function "ttt" line 5 at return next > > Anyone has an idea ? You need to treat it like a table: SELECT * FROM ttt(); Also, I'm not sure you can return a setof anonymous record types (unless you can specify the structure in the select). Try CREATE FUNCTION...RETURNS SETOF utilisateurs.menus If there's no appropriate table you can use CREATE TYPE to create a structure. -- Richard Huxton Archonet Ltd
В списке pgsql-sql по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера