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: 2002-09-29 00:27:37
Message-ID: m265wpljwm.fsf@kuiper.rlent.pnet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>>>>> "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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2002-09-29 02:14:46 Re: Passing array to PL/SQL and looping
Previous Message Ian Barwick 2002-09-28 22:25:06 Re: Passing array to PL/SQL and looping