Re: Assign values to array

From: Arve Fahlvik <afa(at)vivatech(dot)no>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Assign values to array
Date: 2002-06-20 14:56:06
Message-ID: 3D11ED06.80706@vivatech.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)postgresql(dot)org so that your
>> message can get through to the mailing list cleanly
>>
>
>
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Manfred Koizar 2002-06-20 15:01:13 Re: slow DELETE queries
Previous Message Masaru Sugawara 2002-06-20 13:55:43 Re: Joining three data sources.