Using array parameter in Functions plpgsql

From: "Benjamin RICHARD" <benjamin(at)intradot(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Using array parameter in Functions plpgsql
Date: 2003-04-17 14:27:57
Message-ID: 008201c304ed$8aa05730$3c02a8c0@mourmansk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-04-17 14:43:59 Re: Executing queries in C functions
Previous Message Tom Lane 2003-04-17 14:11:56 Re: problem with pl/pgsql