Re: [7.4.6] Calling PLpgSQL stored procedures with table row - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: [7.4.6] Calling PLpgSQL stored procedures with table row
Date
Msg-id Pine.BSO.4.56.0412151831020.741@leary.csoft.net
Whole thread Raw
In response to Re: [7.4.6] Calling PLpgSQL stored procedures with table row arguments via JDBC?  (Eli Bingham <eli@savagebeast.com>)
List 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

pgsql-jdbc by date:

Previous
From: Eli Bingham
Date:
Subject: Re: [7.4.6] Calling PLpgSQL stored procedures with table row arguments via JDBC?
Next
From: Christine Warren
Date:
Subject: Postgresql installation Errors