aliases and set of record
От | Ivan Sergio Borgonovo |
---|---|
Тема | aliases and set of record |
Дата | |
Msg-id | [email protected] обсуждение исходный текст |
Ответы |
Re: [solved] aliases and set of record
|
Список | pgsql-general |
I'd like to use default param so I build up an alias of BasketItems create or replace function BasketItems( _BasketID bigint, _Split boolean, out _ItemID int, out _qty real ) as... create or replace function BasketItems( _BasketID bigint, out _ItemID int, out _qty real ) returns setof record as $$ declare _row record; begin for _row in select _ItemID as __ItemID, _qty as __qty from BasketItems(_BasketID,null) loop _ItemID:=_row.__ItemID; _qty:=_row.__qty; return next; end loop; return; end; $$ language plpgsql; This return 2 empty records _qty and _ItemID are empty select * from BasketItems(2); this returns what's expected: select _ItemID as __ItemID, _qty as __qty from BasketItems(2,null); What's wrong? Any way to fix it keeping the names of the returned columns consistent? -- Ivan Sergio Borgonovo http://www.webthatworks.it
В списке pgsql-general по дате отправления: