Re: working with multidimensional arrays in plpgsql

From: Richard Huxton <dev(at)archonet(dot)com>
To: Sibtay Abbas <sibtay(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: working with multidimensional arrays in plpgsql
Date: 2005-01-26 09:29:53
Message-ID: 41F76311.5030608@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Sibtay Abbas wrote:
> hello everyone
>
> i am having problem with multidimensional arrays in plpgsql following
> is the source code of the function which i am trying to run

> DECLARE
> x INTEGER[10][10];

> x[3][1] := '20'; ------i have even tried x[3][1] = 20

> As you might have observed here, the actual problem is
> how to do assignment to multidimensional array locations using the
> subscript operater.

Actually, the problem is that the array "x" has been initialised to
NULL. Therefore, you can't set individual values. Try a line like:
x := '{}';

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andrei Bintintan 2005-01-26 10:11:49 Re: [SQL] OFFSET impact on Performance???
Previous Message Martin Schäfer 2005-01-26 09:10:43 Re: How to find out programmatically whether a query on a view will use an index?