I am using Oracle (work space is TOAD) and I need to make my strings that if they are shorted then 10 characters then add leading zeros to make them all 10 digit strings.
For example if I have a string like this: '12H89' need to be '0000012H89' or '1234' to be '0000001234'
How can this be done? Whats the best way?
Thanks in advance .
You can use the LPAD function for that, passing in the string, the length you want it to be, and the character to pad it with. For 10 digits with leading zeroes this would be:
LPAD('12H89', 10, '0')
The return value is the padded string.