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 3DF73329D4D for ; Wed, 15 Sep 2004 13:01:37 +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 95814-01 for ; Wed, 15 Sep 2004 12:01:31 +0000 (GMT) Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by svr1.postgresql.org (Postfix) with ESMTP id 36793329CDD for ; Wed, 15 Sep 2004 13:01:30 +0100 (BST) Received: from [127.0.0.1] (tpsoft.gotadsl.co.uk [81.6.252.137]) by smtp.nildram.co.uk (Postfix) with ESMTP id 9DDE0255617 for ; Wed, 15 Sep 2004 13:01:27 +0100 (BST) Message-ID: <41482F1C.4060503@penhey.net> Date: Wed, 15 Sep 2004 13:01:32 +0100 From: Tim Penhey User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "pgsql-jdbc@postgresql.org" Subject: Calling functions with numeric parameters Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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=TO_ADDRESS_EQ_REAL X-Spam-Level: X-Archive-Number: 200409/68 X-Sequence-Number: 10958 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