Bugs item #1655818, was opened at 2007-02-09 09:33
Message generated for change (Comment added) made by mlkersten
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1655818&group_id=56967
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQL/Core
Group: MonetDB5 5.0_beta1
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Anders Blaagaard (ablaagaard)
Assigned to: Niels Nes (nielsnes)
>Summary: SQL:Error inserting float in numeric column using JDBC
Initial Comment:
I'm trying to insert floats into a MonetDB 5.0.0_beta1 db in table like this:
create table P (
time timestamp not null,
x numeric(5,2) not null,
y numeric(5,2) not null
);
using code like this:
PreparedStatement ps = con.prepareStatement("insert into P (time,x,y) values
(?,?,?)");
ps.setTimestamp(1, new Timestamp(time.getTime()));
ps.setFloat(2, x);
ps.setFloat(3, y);
and get an error like this:
java.sql.SQLException: MALException:(unknown):wrong argument for prepared
statement (expected decimal instead of decimal)
Log detials:
TX 1170950011791: sPREPARE insert into P (time,x,y) values (?,?,?);
RD 1170950011791: final block: 189 bytes
RD 1170950011805: read chunk: 189 bytes, left: 0 bytes
RX 1170950011805: &5 2 3 3 3
% prepare, prepare, prepare # table_name
% type, digits, scale # name
% varchar, int, int # type
% 0, 0, 0 # length
[ "timestamp", 7, 0 ]
[ "decimal", 5, 2 ]
[ "decimal", 5, 2 ]
RD 1170950011805: generating prompt
TD 1170950011820: write final block: 57 bytes
TX 1170950011820: sexec 2(timestamp '2003-01-30 18:03:35.0', 71.91, 71.98);
RD 1170950011820: final block: 100 bytes
RD 1170950011820: read chunk: 100 bytes, left: 0 bytes
RX 1170950011820: !MALException:(unknown):wrong argument for prepared statement
(expected decimal instead of decimal)
Note that I don't get this error for all values of x and y.
----------------------------------------------------------------------
>Comment By: Martin Kersten (mlkersten)
Date: 2007-02-09 18:13
Message:
Logged In: YES
user_id=490798
Originator: NO
Tag subject for easy filtering later
----------------------------------------------------------------------
Comment By: Fabian (mr-meltdown)
Date: 2007-02-09 11:55
Message:
Logged In: YES
user_id=963970
Originator: NO
TEST ADDED
sql/src/test/BugTracker/Tests/decimal_prepare.SF-1655818
----------------------------------------------------------------------
Comment By: Fabian (mr-meltdown)
Date: 2007-02-09 11:32
Message:
Logged In: YES
user_id=963970
Originator: NO
Niels, any idea on this one? The error message at least doesn't look
right to me.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1655818&group_id=56967
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs