View Single Post
  #15 (permalink)  
Old 04-02-09, 19:29
nitya nitya is offline
Registered User
 
Join Date: Apr 2009
Posts: 1
Thumbs down DB2 - Decimal to Varchar without leading zeros

Here is a sample workaround. You need to know the precision and scale value of FIELD_NAME.

select CHAR(RTRIM(char(integer(FIELD_NAME))) ||'.'||char(substr(char(decimal(FIELD_NAME,17,2)), 17))) from TABLE_NAME where row_id ='xxxxxx'

Hope this helps ,
-Nitya
Reply With Quote