I want to fix a string to length of 20 characters after the operation. For example, if my string is 1455
then new string should be 00000000000000001455
(20 characters) with 16 0
s in front. Or if my string is 12345678
then new string should be 00000000000012345678
(20 chars) with 12 0
s in front.
I can do it in a user-defined function but I wonder if there is an easy way to do it in Oracle? I googled but couldn't find any similar solution. Any suggestions?
do it like this:
select lpad('1455',20,'0') from dual;