From: John LH <johnlh@aquafold.com>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: JDBC CallableStatement bug on functions with return parameter
Date: Sat, 05 Feb 2011 08:21:47 -0800
Message-ID: <4D4D791B.30704@aquafold.com> (raw)
In-Reply-To: <4D4D1729020000250003A44E@gw.wicourts.gov>
References: <4D4D1729020000250003A44E@gw.wicourts.gov>
Hi,
I create the CallableStatement with this :
callStatement = conn.prepareCall("{ ? = CALL "public"."sales_tax"(?) }");
For the return parameter I use :
callStatement.registerOutParameter(1, java.sql.Types.FLOAT);
For the function parameter I use :
callStatement.setObject(2, new Float(25.25));
After this, the Jdbc4CallableStatement SQL is :
select * from "public"."sales_tax"(null,25.25) as result
When I callStatement.execute() I get this :
org.postgresql.util.PSQLException: ERROR: function
public.sales_tax(double precision) does not exist
I've also tried the combination and results of ...
===
java.sql.Types.DOUBLE/Double
org.postgresql.util.PSQLException: ERROR: function
public.sales_tax(double precision) does not exist
===
java.sql.Types.NUMERIC/BigDecimal
org.postgresql.util.PSQLException: ERROR: function
public.sales_tax(numeric) does not exist
thanks
-John
On 2/5/2011 7:23 AM, Kevin Grittner wrote:
> John LH wrote:
>
>> I have a function "sales_tax (in subtotal money) RETURNS money"
>
>> I register the parameters and then execute the statement, but it
>> fails with the error message :
>>
>> ERROR: function public.sales_tax(double precision) does not exist
>
> What class of Java object are you trying to use for the parameter?
>
> -Kevin
>
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: johnlh@aquafold.com, Kevin.Grittner@wicourts.gov
Subject: Re: JDBC CallableStatement bug on functions with return parameter
In-Reply-To: <4D4D791B.30704@aquafold.com>
References: <4D4D1729020000250003A44E@gw.wicourts.gov> <4D4D791B.30704@aquafold.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