Pro. Regarding Arrays.

From: "Pankaj Soni" <abhi_soni(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Pro. Regarding Arrays.
Date: 2000-11-17 13:37:32
Message-ID: F22YILoygXLsxpTljBO0000061b@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello All,

I am Working on pgsqls user defined arrays.
if i am using arrays as l-value then '[]' doesnt give any error
but if i am trying to assign some value to any element of the array
then it gives error.
the function i am using as follows...

CREATE TYPE int_array_t (
INPUT = array_in,
OUTPUT = array_out,
INTERNALLENGTH = VARIABLE,
ELEMENT = int4
);

create function test_int_array()
returns int4 as

'declare
array_input int_array_t;
count int4;

begin
-- Initialize
count := 0;
array_input := ''{1, 2, 3}'';

while array_input[count + 1] IS NOT NULL
loop
count := count + 1;
count := array_input[count];
end loop;

return count;
end;'
/*
if i use array_input[Count]:=Count; then it gives compilation error

NOTICE: plpgsql: ERROR during compile of test_int_array near line 15
ERROR: parse error at or near "["
*/

Please guide me
Thanks
Pankaj

language 'plpgsql';

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

Browse pgsql-general by date

  From Date Subject
Next Message Adam Lang 2000-11-17 14:40:12 Re: What language
Previous Message Arun Prasad 2000-11-17 13:11:01 About arrays in plpgsql.