Skip site navigation (1) Skip section navigation (2)

Calling functions with numeric parameters

From: Tim Penhey <tim(at)penhey(dot)net>
To: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Calling functions with numeric parameters
Date: 2004-09-15 12:01:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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.


pgsql-jdbc by date

Next:From: Dave CramerDate: 2004-09-15 12:36:09
Subject: Re: Calling functions with numeric parameters
Previous:From: Kris JurkaDate: 2004-09-15 05:36:18
Subject: Re: Customizing SSL with jdbc

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group