pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Sibtay Abbas <sibtay@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: working with multidimensional arrays in plpgsql
Date: Wed, 26 Jan 2005 09:29:53 +0000
Message-ID: <41F76311.5030608@archonet.com> (raw)
In-Reply-To: <bd6a3551050125230248d49296@mail.gmail.com>
References: <bd6a3551050125230248d49296@mail.gmail.com>

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



view thread (4+ messages)  latest in thread

Message-ID: <41F76311.5030608@archonet.com>
Permalink:  ../41F76311.5030608@archonet.com/
Also on:    postgresql.org/message-id/41F76311.5030608@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, sibtay@gmail.com
  Subject: Re: working with multidimensional arrays in plpgsql
  In-Reply-To: <41F76311.5030608@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox