Re: How to iterate through arrays?

From: PFC <lists(at)boutiquenumerique(dot)com>
To: NosyMan <nosyman(at)gmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: How to iterate through arrays?
Date: 2005-02-09 14:16:33
Message-ID: opslxolvodth1vuj@musicbox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


- use TEXT instead of CHAR (what is CHAR without (n) ?)
- inintialize your array with '{}' because it is created as NULL if you
just declare it without setting it to an empty array.

> Hi there,
>
> I'm trying to iterate through arrays in PL/PGSQL:
> ....
> DECLARE
> update_query CHAR;
> update_query_params CHAR ARRAY[6];
> BEGIN
> update_query_params[1]:='some text';
>
> RAISE NOTICE 'Testing element %', update_query_params[1];
> END
> .....
>
>
> It does not 'compile'... :-(. Can you tell me what is the problem?
>
> Thanks,
> Nosy
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message NosyMan 2005-02-09 14:26:41 Re: How to iterate through arrays?
Previous Message NosyMan 2005-02-09 13:59:08 How to iterate through arrays?