Connecting Tech Pros Worldwide Forums | Help | Site Map

How can i modify the following query in DB2

Newbie
 
Join Date: Nov 2008
Posts: 1
#1: Nov 7 '08
How can i modify the following query in DB2

(CAST(SUBS_REFILL_COUPONNO_CHANNELID AS INTEGER) (FORMAT '9(16)') (CHAR(16)) )

where SUBS_REFILL_COUPONNO_CHANNELID is the column name of my table that contains 12,14 & 16 digit number. but i want all the numbers in 16 digit by adding the as many zero in the front, when i am using select query.

e.g. 678978654543 should be displayed as 0000678978654543
67897865454312 should be displayed as 0067897865454312

pls help

Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#2: Nov 11 '08

re: How can i modify the following query in DB2


You can simulate a left pad by concatenating the value with a REPEAT of the value you are padding with.
Reply