IBM DB2 LPAD / RPAD

I am using db2 v.9.1 on windows 2003 server, so it cannot use LPAD or RPAD functions. because these features only support z / OS right?

Now I use this path for pad notes when COLUMN1 type is VARCHAR

 RIGHT('0000' ||  COLUMN1 ,4) AS  RPAD
 LEFT('0000' ||  COLUMN1 ,4) AS  LPAD

      

Is there a better way to replace LPAD or RPAD function?

0


source to share


1 answer


I think you probably want the REPEAT scalar function.



+1


source







All Articles