Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id B53A1476830 for ; Thu, 20 Jun 2002 11:06:23 -0400 (EDT) Received: from server236a.web2wap.no (unknown [213.236.129.46]) by postgresql.org (Postfix) with ESMTP id E7936476ADA for ; Thu, 20 Jun 2002 10:54:38 -0400 (EDT) Received: from vivatech.no (afa@maskin52.hgsd-lokal.web2wap.no [172.22.90.101]) by server236a.web2wap.no (8.11.0/8.11.0) with ESMTP id g5KEmGq24490 for ; Thu, 20 Jun 2002 16:48:16 +0200 Message-ID: <3D11ED06.80706@vivatech.no> Date: Thu, 20 Jun 2002 16:56:06 +0200 From: Arve Fahlvik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020412 Debian/0.9.9-6 X-Accept-Language: no, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Assign values to array References: <200206192039.g5JKd8q22527@server236a.web2wap.no> <3D11D8D7.7060906@asti.dost.gov.ph> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200206/275 X-Sequence-Number: 8240 Thanks I can see the logic now, but have still problems. declare t integer[3]; begin t[1]:='{4}'; return 0; end; apollo3-stat=# select test(); NOTICE: plpgsql: ERROR during compile of test near line 4 ERROR: parse error at or near "[" apollo3-stat=# Joseph Syjuco wrote: > try out > t[1]:='{4}' > afa wrote: > >> Hello >> >> I have made this simple test function: >> >> declare >> t integer[3]; >> u integer; >> begin >> u:=t[1]; >> t[1]:=4; >> return 0; >> end; >> >> This is the results when i execute it: >> >> apollo3-stat=# select test(); >> NOTICE: plpgsql: ERROR during compile of test near line 6 >> ERROR: parse error at or near "[" >> apollo3-stat=# >> This tells me that the assignment to u is ok. >> How can i assign something to the t array? >> >> I'm running versjon 7.2.1 >> >> afa >> >> ------------------------------------------------------------------- >> -->> Add WEB ACCESS to your POP email accounts with >> -->> FREE Perl CGI scripts! Download today! http://www.adjeweb.com >> ------------------------------------------------------------------- >> >> ---------------------------(end of broadcast)--------------------------- >> TIP 3: if posting/reading through Usenet, please send an appropriate >> subscribe-nomail command to majordomo@postgresql.org so that your >> message can get through to the mailing list cleanly >> > > > >