views:

10

answers:

1

Running DB2 8.2 Fixpak 18 for LUW, I need to convert a DECIMAL field to a IMPLIEDDECIMAL for a file export.

I cannot find anything in the documentation online, please help.

A: 

Just multiply the value of the column by 10^scale of the decimal column and convert it to an integer. So, for a DECIMAL(12,4) column: 10^4 = 10000, and:

cast(yourcol * 10000 as bigint)

If a row has a value of 3.1415, this will result in 31415.

Ian Bjorhovde