Using array parameter in Functions plpgsql - Mailing list pgsql-general

From Benjamin RICHARD
Subject Using array parameter in Functions plpgsql
Date
Msg-id 008201c304ed$8aa05730$3c02a8c0@mourmansk
Whole thread Raw
List pgsql-general
Hi,
 
I'm trying to use array in a function but it seems to be a little bit harder than i thought.
So i have a function with 2 parameters 'INTEGER[]' and 'INTEGER'
in this function i would like to loop in the array ($1) to realize dynamic insert query like this
 
LOOP
INSERT INTO myTable ($2 , current value of $1)
END LOOP
 
Is it possible ?
 
Thanks

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: problem with pl/pgsql
Next
From: Tom Lane
Date:
Subject: Re: Executing queries in C functions