function returning array

Поиск
Список
Период
Сортировка
От Dennis
Тема function returning array
Дата
Msg-id courier.407C6CB0.00005135@wolverine.lercnetworks.com
обсуждение исходный текст
Ответы Re: function returning array  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: function returning array  (Joe Conway <mail@joeconway.com>)
Список pgsql-sql
I am trying to return an array from a function and don't seem to be having 
luck. The function seems to work fine, but if I do assignment to an array 
variable, I get null in the array elements 

DECLARE  results varchar[];  tmpv varchar;
BEGIN  -- now call func that returns varchar[]  results := parseString(''abc,def,ghi'','','');  tmpv := results[1];
RAISENOTICE '' tmpv = % '',tmpv;    -- tmpv will be null.
 

END; 

I found reference to this sort of thing not working, but the reference was 
from several years ago, so I'm not sure if that is still the case or if I am 
doing something wrong. 

Do I need to go with returning a set instead? 

Dennis S
pg-user@calico-consulting.com 




В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: trigger/for key help
Следующее
От: Tom Lane
Дата:
Сообщение: Re: function returning array