Skip site navigation (1) Skip section navigation (2)

Re: [7.4.6] Calling PLpgSQL stored procedures with table row

From: Kris Jurka <books(at)ejurka(dot)com>
To: Eli Bingham <eli(at)savagebeast(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [7.4.6] Calling PLpgSQL stored procedures with table row
Date: 2004-12-15 23:37:12
Message-ID: Pine.BSO.4.56.0412151831020.741@leary.csoft.net (view raw or flat)
Thread:
Lists: pgsql-jdbc

On Wed, 15 Dec 2004, Eli Bingham wrote:

> In regards to the specific solution that you offer above with a 
> function that creates row objects, would it be possible to invoke a 
> composed function via a CallableStatement in Postgres JDBC, like this:
> 
> CallableStatement proc = conn.prepareCall ("{ ? = call do_stuff 
> (create_foobar (?, ?)) }");
> proc.registerOutParameter (1, Types.INTEGER);
> proc.setObject (2, x);
> proc.setObject (3, y);
> 

Yes, this should work fine, behind the scenes the driver rewrites

{? = call func(?)}

into:

SELECT * FROM func(?);

So you should be able to test what a CallableStatement will do directly in 
SQL.

Kris Jurka

In response to

pgsql-jdbc by date

Next:From: Christine WarrenDate: 2004-12-16 13:44:57
Subject: Postgresql installation Errors
Previous:From: Eli BinghamDate: 2004-12-15 23:21:23
Subject: Re: [7.4.6] Calling PLpgSQL stored procedures with table row arguments via JDBC?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group