Re: how to pass an array to the plpgsql function from Java Code - Mailing list pgsql-general

From ksherlock@gmail.com
Subject Re: how to pass an array to the plpgsql function from Java Code
Date
Msg-id 1173126928.941993.56790@t69g2000cwt.googlegroups.com
Whole thread Raw
In response to how to pass an array to the plpgsql function from Java Code  ("Sandeep Kumar Jakkaraju" <sandeepkumar.jakkaraju@gmail.com>)
List pgsql-general
On Mar 4, 11:34 am, sandeepkumar.jakkar...@gmail.com ("Sandeep Kumar
Jakkaraju") wrote:
> how to pass an array to the plpgsql function from Java Code ??

If nothing else, you could use the ARRAY[] constructor:

int [] ar = {1,2,3};
PreparedStament pre= connection.prepareStatement( " select
test(ARRAY[?,?,?]) ");

pre.setArray(1,ar[0]);
pre.setArray(2,ar[1]);
pre.setArray(3,ar[2]);




pgsql-general by date:

Previous
From: "lissette"
Date:
Subject: Postgres ebmail and hermes
Next
From: Andy
Date:
Subject: Re: Importing *huge* mysql database into pgsql