How can i modify the following query in DB2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajeev14th
    New Member
    • Nov 2008
    • 1

    How can i modify the following query in DB2

    How can i modify the following query in DB2

    (CAST(SUBS_REFI LL_COUPONNO_CHA NNELID AS INTEGER) (FORMAT '9(16)') (CHAR(16)) )

    where SUBS_REFILL_COU PONNO_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 000067897865454 3
    67897865454312 should be displayed as 006789786545431 2

    pls help
    Last edited by rajeev14th; Nov 7 '08, 08:38 AM. Reason: to explain more about the problem
  • r035198x
    MVP
    • Sep 2006
    • 13225

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

    Comment

    Working...