Re: Passing array to PL/SQL and looping
- From: Roland Roberts <roland(at)astrofoto(dot)org>
- To: pgsql-sql(at)postgresql(dot)org
- Subject: Re: Passing array to PL/SQL and looping
- Date: 28 Sep 2002 20:27:37 -0400
- Message-id: <m265wpljwm.fsf@kuiper.rlent.pnet> <text/plain>
>>>>> "Greg" == Greg Johnson <gregj(at)interprose(dot)com> writes:
Greg> CREATE FUNCTION test_array( ) RETURNS VARCHAR[] AS '
Greg> DECLARE
Greg> return_array VARCHAR[];
Greg> BEGIN
Greg> return_array[0] := ''test'';
Greg> return_array[1] := ''test 1'';
Greg> return_array[2] := ''test 2'';
Greg> RETURN (return_array);
Greg> END;'
Greg> LANGUAGE 'plpgsql';
Greg> I get the following error when I try to run it:
Greg> ERROR: parse error at or near "[" on line 4.
I raised this issue when dealing with version 7.1 and the conclusion
was that PL/PgSQL doesn't understand array syntax. If you construct
the array as { val, val, val, ... } it works, but that is not a
practical solution for most uses.
What can we do to at least get this on the radar screen as a known
bug?
roland
--
PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD RL Enterprises
roland(at)rlenter(dot)com 76-15 113th Street, Apt 3B
roland(at)astrofoto(dot)org Forest Hills, NY 11375
Home |
Main Index |
Thread Index