updated at a single element in a array using pl/pgsql

Started by Cristian Custodioabout 23 years ago2 messagesgeneral
Jump to latest
#1Cristian Custodio
crstian@terra.com.br

Can I update a single element in a array?

CREATE OR REPLACE FUNCTION TESTEARRAY() RETURNS CHAR AS '
DECLARE
v_array integer[];
BEGIN
v_array[1] := 10; -- Parser error at or near ''[''
RETURN v_array[1];
END;
'language 'plpgsql';

Cristian

#2Dennis Gearon
gearond@cvc.net
In reply to: Cristian Custodio (#1)
Re: updated at a single element in a array using pl/pgsql

All this talk about arrays is that they are finally in pl-pgsql? useful feature! I thought that
arrays were some kind of extension to SQL.

3/12/2003 9:04:23 AM, "Cristian Custodio" <crstian@terra.com.br> wrote:

Show quoted text

Can I update a single element in a array?

CREATE OR REPLACE FUNCTION TESTEARRAY() RETURNS CHAR AS '
DECLARE
v_array integer[];
BEGIN
v_array[1] := 10; -- Parser error at or near ''[''
RETURN v_array[1];
END;
'language 'plpgsql';

Cristian

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html