pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Eli Bingham <eli@savagebeast.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [7.4.6] Calling PLpgSQL stored procedures with table row
Date: Wed, 15 Dec 2004 18:37:12 -0500 (EST)
Message-ID: <Pine.BSO.4.56.0412151831020.741@leary.csoft.net> (raw)
In-Reply-To: <08F2890B-4EF0-11D9-895F-000D932A4B80@savagebeast.com>
References: <F50C32D5-4EE7-11D9-895F-000D932A4B80@savagebeast.com>
	<Pine.BSO.4.56.0412151756440.28062@leary.csoft.net>
	<08F2890B-4EF0-11D9-895F-000D932A4B80@savagebeast.com>



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



view thread (4+ messages)

Message-ID: <Pine.BSO.4.56.0412151831020.741@leary.csoft.net>
Permalink:  ../Pine.BSO.4.56.0412151831020.741@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.56.0412151831020.741@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, eli@savagebeast.com
  Subject: Re: [7.4.6] Calling PLpgSQL stored procedures with table row
  In-Reply-To: <Pine.BSO.4.56.0412151831020.741@leary.csoft.net>
  References: <F50C32D5-4EE7-11D9-895F-000D932A4B80@savagebeast.com> <Pine.BSO.4.56.0412151756440.28062@leary.csoft.net> <08F2890B-4EF0-11D9-895F-000D932A4B80@savagebeast.com> <Pine.BSO.4.56.0412151831020.741@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox