| От | Craig Ringer |
|---|---|
| Тема | Re: returning array from function or "structured error" |
| Дата | |
| Msg-id | 47F05205.5010908@postnewspapers.com.au обсуждение исходный текст |
| Ответ на | returning array from function or "structured error" (Ivan Sergio Borgonovo <mail@webthatworks.it>) |
| Список | pgsql-general |
Ivan Sergio Borgonovo wrote: > Building up a temp table and returning a "setof record" You can avoid the temp table and return `setof record'. Just `RETURN NEXT temp_result' after each test, where temp_result is your declared working variable. When you're done with all tests, do the final RETURN. No need for temp tables anywhere - your PHP invokes the function as `SELECT * FROM test_something(args)' and gets a normal resultset back, just as if it'd performed a SELECT from a table. Personally, though I'd: CREATE TYPE test_result AS ( test_id INTEGER, test_outcome TEXT ); or whatever's appropriate for your use, then declare the function as `RETURNS SETOF test_result'. -- Craig Ringer
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера