Re: How to iterate through arrays? - Mailing list pgsql-sql

From PFC
Subject Re: How to iterate through arrays?
Date
Msg-id opslxolvodth1vuj@musicbox
Whole thread Raw
In response to How to iterate through arrays?  (NosyMan <nosyman@gmail.com>)
Responses Re: How to iterate through arrays?
List 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@postgresql.org)
>




pgsql-sql by date:

Previous
From: NosyMan
Date:
Subject: How to iterate through arrays?
Next
From: NosyMan
Date:
Subject: Re: How to iterate through arrays?