pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: Tim Penhey <tim@penhey.net>
Cc: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: Calling functions with numeric parameters
Date: Wed, 15 Sep 2004 08:36:09 -0400
Message-ID: <1095251769.1549.157.camel@localhost.localdomain> (raw)
In-Reply-To: <41482F1C.4060503@penhey.net>
References: <41482F1C.4060503@penhey.net>

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




view thread (4+ messages)  latest in thread

Message-ID: <1095251769.1549.157.camel@localhost.localdomain>
Permalink:  ../1095251769.1549.157.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1095251769.1549.157.camel@localhost.localdomain

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: pg@fastcrypt.com, tim@penhey.net
  Subject: Re: Calling functions with numeric parameters
  In-Reply-To: <1095251769.1549.157.camel@localhost.localdomain>
  References: <41482F1C.4060503@penhey.net> <1095251769.1549.157.camel@localhost.localdomain>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox