Quote
How can I right pad the number with Zeros to make sure it's always 20 digits?
Short answer - You shouldn't.
Numbers
don't have fixed, leading zeroes. They're just numbers.
BTW, whilst you can add
trailing zeroes to a numeric value, doing so results in a totally different, numeric value.
If you want the
Character Representation of your numbers to include leading zeroes then yes, you can do that, but you should store such values in a column with a
Character Data Type.
It's just
not worth running the Risk of an "unexpected" Type Conversion messing up your value comparisons.
'1' != '00000000000000000001'
'1' != '10000000000000000000'
'00000000000000000001' != '10000000000000000000'
Regards, Phill W.