X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CAE23329D58 for ; Wed, 15 Sep 2004 13:33:58 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 05532-04 for ; Wed, 15 Sep 2004 12:33:52 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id CE5B5329C63 for ; Wed, 15 Sep 2004 13:33:53 +0100 (BST) Received: (qmail 17183 invoked from network); 15 Sep 2004 12:34:16 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 15 Sep 2004 12:34:16 -0000 Subject: Re: Calling functions with numeric parameters From: Dave Cramer Reply-To: pg@fastcrypt.com To: Tim Penhey Cc: "pgsql-jdbc@postgresql.org" In-Reply-To: <41482F1C.4060503@penhey.net> References: <41482F1C.4060503@penhey.net> Content-Type: text/plain Organization: Cramer Consulting Message-Id: <1095251769.1549.157.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 15 Sep 2004 08:36:09 -0400 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/69 X-Sequence-Number: 10959 Tim, Use setBigDecimal Dave On Wed, 2004-09-15 at 08:01, Tim Penhey wrote: > Hi All, > > I have a plpgsql function that takes a numeric parameter. It is for a > price in a table. The table has the price declared as numeric(10,2), > and the function parameter is just numeric. However in Java I have the > price represented as a double. > > Using jdbc setDouble for a parameter for the function causes causes an > ERROR saying that the function taking a double precision parameter does > not exist (which is obviously correct). > > What do other people do? > > Is there a way to pass a numeric parameter through JDBC? > Should the parameter to the function be a double which is the "cast" > into the numeric inside the function? > > Your ideas are welcome. > Tim > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) -- Dave Cramer 519 939 0336 ICQ # 14675561 www.postgresintl.com