db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mariusz G <mar...@o2.pl>
Subject function - returns decimal
Date Tue, 17 Jul 2007 12:58:37 GMT
There is a test function:

create function round(a decimal(31,11), scale integer) returns
decimal(31,11)
parameter style java no sql language java
external name 'derbyextension.Derby.round'; 

Why this function returns decimal(31,31) instead of decimal(31,11)?

ij> values round(0.225,2);
1
---------------------------------
0.2300000000000000000000000000000

1 row selected

ij> values round(1.225,2);
1
---------------------------------
ERROR 22003: Overflow occurred during numeric data type conversion of
"1.23000000000". :


Mime
View raw message