pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: thomas.risberg <thomas.risberg@tridb.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: getProcedureColumns
Date: Mon, 2 Jul 2007 11:31:26 -0700 (PDT)
Message-ID: <11399288.post@talk.nabble.com> (raw)
In-Reply-To: <Pine.BSO.4.64.0707021335270.10072@leary.csoft.net>
References: <1C85230A-C17D-4601-B84E-6F43176C5D6D@gmail.com>
	<Pine.BSO.4.64.0701311619160.27765@leary2.csoft.net>
	<53951298-D245-4EB2-9C3E-EA05A48C77BA@gmail.com>
	<Pine.BSO.4.64.0701311846100.18318@leary2.csoft.net>
	<1D8F84DE-26E9-4C88-B6F4-A7A74B85DE5C@gmail.com>
	<Pine.BSO.4.64.0702140133500.4318@leary.csoft.net>
	<3599D18B-946A-461B-9429-89E0A4868345@gmail.com>
	<Pine.BSO.4.64.0702141026340.23853@leary.csoft.net>
	<110D999D-C0C2-47D8-8905-56B3CA04ED45@gmail.com>
	<Pine.BSO.4.64.0702141243080.3571@leary.csoft.net>
	<CC7F861E-B729-47E7-BD82-A552100A8F21@gmail.com>
	<Pine.BSO.4.64.0702280240160.9224@leary.csoft.net>
	<11398134.post@talk.nabble.com>
	<Pine.BSO.4.64.0707021335270.10072@leary.csoft.net>


Thanks Kris.  I'll keep an eye on the 8.3dev drivers.

A related question - I have the following proc declaration:

create function my_proc(in_text in varchar, in_number in numeric, out_result
out varchar, out_text out varchar) RETURNS record

Since there are multiple out parameters it seemed as if I was forced to
declare the return as a record. Is this assumption correct?

Looking at the metadata for this proc I see:
- my_proc 5 1111 record 
- my_proc 1 12 varchar 
- my_proc 1 2 numeric 

but this doesn't seem to be enough tp actually build the call statement and
executing the proc.  Using con.prepareCall("{? = call my_proc(?, ?)}") - I
get org.postgresql.util.PSQLException: A CallableStatement was excecuted
with an invalid number of parameters.

Switching to con.prepareCall("{? = call my_proc(?, ?, ?)}") I can get it to
work but only by registering two  out parameters of Types.VARCHAR.  So it
seems that it is not possible to construct the appropriate call sequence
just based on the metadata when there are multiple out parameters.

Any insights are appreciated.

Thanks,
Thomas Risberg 




Kris Jurka wrote:
> 
> 
> 
> On Mon, 2 Jul 2007, thomas.risberg wrote:
> 
>> Did this patch ever make it into the codebase?  I'm interested in getting
>> the actual names declared when the function was declared rather than the
>> $x
>> placeholders.  Currently testing with postgresql-8.2-505.jdbc3.jar and
>> this
>> change doesn't seem to be in there.
>>
> 
> It has not made it into the driver yet because I haven't done the testing 
> against all our supported server versions yet.  In any case it will not 
> appear in the 8.2 series release because it is a new feature and will 
> instead appear in the 8.3 release.
> 
> Kris Jurka
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
> 
> 

-- 
View this message in context: http://www.nabble.com/getProcedureColumns-tf3147414.html#a11399288
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.




view thread (21+ messages)  latest in thread

Message-ID: <11399288.post@talk.nabble.com>
Permalink:  ../11399288.post@talk.nabble.com/
Also on:    postgresql.org/message-id/11399288.post@talk.nabble.com

 · 

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: thomas.risberg@tridb.com
  Subject: Re: getProcedureColumns
  In-Reply-To: <11399288.post@talk.nabble.com>
  References: <1C85230A-C17D-4601-B84E-6F43176C5D6D@gmail.com> <Pine.BSO.4.64.0701311619160.27765@leary2.csoft.net> <53951298-D245-4EB2-9C3E-EA05A48C77BA@gmail.com> <Pine.BSO.4.64.0701311846100.18318@leary2.csoft.net> <1D8F84DE-26E9-4C88-B6F4-A7A74B85DE5C@gmail.com> <Pine.BSO.4.64.0702140133500.4318@leary.csoft.net> <3599D18B-946A-461B-9429-89E0A4868345@gmail.com> <Pine.BSO.4.64.0702141026340.23853@leary.csoft.net> <110D999D-C0C2-47D8-8905-56B3CA04ED45@gmail.com> <Pine.BSO.4.64.0702141243080.3571@leary.csoft.net> <CC7F861E-B729-47E7-BD82-A552100A8F21@gmail.com> <Pine.BSO.4.64.0702280240160.9224@leary.csoft.net> <11398134.post@talk.nabble.com> <Pine.BSO.4.64.0707021335270.10072@leary.csoft.net> <11399288.post@talk.nabble.com>

* 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