Re: functions are returns columns
От | Michele Petrazzo - Unipex srl |
---|---|
Тема | Re: functions are returns columns |
Дата | |
Msg-id | 4735EC6F.5050908@unipex.it обсуждение исходный текст |
Ответ на | Re: functions are returns columns ("Pavel Stehule" <pavel.stehule@gmail.com>) |
Ответы |
Re: functions are returns columns
|
Список | pgsql-sql |
Pavel Stehule wrote: > > CREATE FUNCTION getfoo(int) RETURNS foo AS $$ SELECT fooid, foosubid > FROM foo WHERE fooid = $1 LIMIT 1; $$ LANGUAGE SQL; > this return only one value, I need all the values that return the query > or > > CREATE FUNCTION getfoo(int) RETURNS SETOF foo AS $$ SELECT fooid, > foosubid FROM foo WHERE fooid = $1; $$ LANGUAGE SQL; > this create the same error: ERROR: return type mismatch in function declared to return foo DETAIL: Final SELECT returns too few columns. CONTEXT: SQL function "getfoo I try with: CREATE FUNCTION getfoo (IN int, OUT int, OUT int) AS $$ SELECT fooid, foosubid FROM foo WHERE fooid = $1; $$ LANGUAGE SQL; but only one row returned... Looking for other tips! Thanks, Michele
В списке pgsql-sql по дате отправления: