Thread: arrays in stored procedures

arrays in stored procedures

From
Dalton Shane
Date:
Thank you for all your help before this. There was some problem with the server 
and my post got sent three or four times, strange times are upon us.

Anyway I would like to use arrays in a stored procedure I'm writing and the 
compiler doesn't seem to like it.

Are arrays supported in PL/Psql?

How would one find the length of an array?

What I am trying to do is run a select which will return 5 values, which are 
then stuck into an array........................but I can't get it working.

If anybody has any ideas, I would be very grateful

Below is the simplest thing I can think of for an array and yet it won't work.

I've read the documentation but it doesn't say anything about arrays and stored 
procedures

Thanks

Shane.

---------------------------------------------------------------

drop function collie();

CREATE FUNCTION collie() RETURNS integer AS 'DECLARE    rooskey integer[];    shane integer;BEGIN     shane :=
rooskey[1]= {23};        RETURN shane;END;        
 
' LANGUAGE 'plpgsql';

-------------------------------------------------------------------