Hi Fred, Thanks for your feedback! You're right, in a simple INSERT statement like this, the cast is probably not needed, as HSQLDB infers the type at SQL parse time. But for H2 and HSQLDB, I can never be sure when bind variable types are indeed inferred and when they aren't, so jOOQ prefers to always cast, just to be sure. Unfortunately, in this case, casting was done wrong.
Cheers Lukas Note, I have cc'ed this message to the jOOQ user group, as it might be of general interest for jOOQ users using HSQLDB 2011/9/1 Fred Toussi <[email protected]>: > Hi Lukas, > > Saw this today on a gmane search > > To ensure the strong typesafety required by > HSQLDB, jOOQ renders and prepares your insert statement as > > insert into "Z" ("D") values (cast(? as numeric)) > > > AFAIR in the latest versions of HSQLDB you should't need this cast if > the parameter is a BigDecimal of any scale. HSQLDB should covert it to > the scale defined in the CREATE TABLE. If the inserted value has more > fractional digits than the definition, it should truncate it. > > Please check without the cast and let me know if there is any problem. > > Regards > > Fred >
