Re: how to pass an array to the plpgsql function from Java Code

From: "ksherlock(at)gmail(dot)com" <ksherlock(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: how to pass an array to the plpgsql function from Java Code
Date: 2007-03-05 20:35:30
Message-ID: 1173126928.941993.56790@t69g2000cwt.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mar 4, 11:34 am, sandeepkumar(dot)jakkar(dot)(dot)(dot)(at)gmail(dot)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]);

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Hammond 2007-03-06 01:07:03 RFC tool to support development / operations work with slony replicated databases
Previous Message Omar Eljumaily 2007-03-05 19:49:14 Re: M:M table conditional delete for parents