Calling functions with numeric parameters - Mailing list pgsql-jdbc

From Tim Penhey
Subject Calling functions with numeric parameters
Date
Msg-id 41482F1C.4060503@penhey.net
Whole thread Raw
Responses Re: Calling functions with numeric parameters  (Dave Cramer <pg@fastcrypt.com>)
Re: Calling functions with numeric parameters  (Paul Thomas <paul@tmsl.demon.co.uk>)
List pgsql-jdbc
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


pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Customizing SSL with jdbc
Next
From: Dave Cramer
Date:
Subject: Re: Calling functions with numeric parameters