Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 59C1E1337B51 for ; Sat, 5 Feb 2011 12:22:23 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 44825-03 for ; Sat, 5 Feb 2011 16:22:16 +0000 (UTC) X-Greylist: delayed 16:16:38.272049 by SQLgrey-1.7.6 Received: from mail-gw0-f46.google.com (mail-gw0-f46.google.com [74.125.83.46]) by mail.postgresql.org (Postfix) with ESMTP id CFC561337B49 for ; Sat, 5 Feb 2011 12:22:15 -0400 (AST) Received: by gwj20 with SMTP id 20so1274255gwj.19 for ; Sat, 05 Feb 2011 08:22:14 -0800 (PST) Received: by 10.100.13.20 with SMTP id 20mr2367353anm.76.1296922934021; Sat, 05 Feb 2011 08:22:14 -0800 (PST) Received: from [10.168.2.218] ([64.245.2.62]) by mx.google.com with ESMTPS id c28sm2553502ana.21.2011.02.05.08.22.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 05 Feb 2011 08:22:13 -0800 (PST) Message-ID: <4D4D791B.30704@aquafold.com> Date: Sat, 05 Feb 2011 08:21:47 -0800 From: John LH User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.9) Gecko/20100915 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: Kevin Grittner CC: pgsql-jdbc@postgresql.org Subject: Re: JDBC CallableStatement bug on functions with return parameter References: <4D4D1729020000250003A44E@gw.wicourts.gov> In-Reply-To: <4D4D1729020000250003A44E@gw.wicourts.gov> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.6 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7 X-Spam-Level: X-Archive-Number: 201102/25 X-Sequence-Number: 21423 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 >