Re: [GENERAL] Looping through Arrays

2006-10-11 Thread Merlin Moncure
On 10/10/06, adam lawrence <[EMAIL PROTECTED]> wrote: But now I need to loop through the whole array, not just the one element. I want to do something like: FOR j in LOOP FOR i IN array_lower(arrayvar,1) .. array_upper(arrayvar,1) LOOP currentvalue:=arrayvar[j][i]; RAISE NOTICE '

[GENERAL] Looping through Arrays

2006-10-11 Thread adam lawrence
HiI want to be able to loop through an array. The code I have used in the past is: FOR i IN array_lower(arrayvar,1) .. array_upper(arrayvar,1) LOOP currentvalue:=arrayvar[1][i]; RAISE NOTICE '%', currentvalue; END LOOP;But now I need to loop through the whole array, not just the one element. I w

Re: [GENERAL] Looping through arrays

2005-11-04 Thread Joe Conway
Robert Fitzpatrick wrote: I have a field with 'AA-BB-CC-DD' and I want to pull those four values into an array and then loop through the array inserting records into a table for each element. Can you someone point me to an example of this in pl/pgsql? Something like this? create table testfoo

Re: [GENERAL] Looping through arrays

2005-11-03 Thread David Fetter
On Thu, Nov 03, 2005 at 06:15:08PM -0500, Robert Fitzpatrick wrote: > I have a field with 'AA-BB-CC-DD' and I want to pull those four > values into an array and then loop through the array inserting > records into a table for each element. Can you someone point me to > an example of this in pl/pgsq

Re: [GENERAL] Looping through arrays

2005-11-03 Thread Michael Fuhr
On Thu, Nov 03, 2005 at 06:15:08PM -0500, Robert Fitzpatrick wrote: > I have a field with 'AA-BB-CC-DD' and I want to pull those four values > into an array and then loop through the array inserting records into a > table for each element. Can you someone point me to an example of this > in pl/pgsq

[GENERAL] Looping through arrays

2005-11-03 Thread Robert Fitzpatrick
I have a field with 'AA-BB-CC-DD' and I want to pull those four values into an array and then loop through the array inserting records into a table for each element. Can you someone point me to an example of this in pl/pgsql? -- Robert ---(end of broadcast)---