pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dennis <pg-user@calico-consulting.com>
To: postgres SQL <pgsql-sql@postgresql.org>
Subject: function returning array
Date: Tue, 13 Apr 2004 18:41:52 -0400
Message-ID: <courier.407C6CB0.00005135@wolverine.lercnetworks.com> (raw)

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];
   RAISE NOTICE '' 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 





view thread (6+ messages)  latest in thread

Message-ID: <courier.407C6CB0.00005135@wolverine.lercnetworks.com>
Permalink:  ../courier.407C6CB0.00005135@wolverine.lercnetworks.com/
Also on:    postgresql.org/message-id/courier.407C6CB0.00005135@wolverine.lercnetworks.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pg-user@calico-consulting.com
  Subject: Re: function returning array
  In-Reply-To: <courier.407C6CB0.00005135@wolverine.lercnetworks.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox