I need to pad numbers with leading zeros (total 8 digits) for display. I\'m using oracle.
select to_char(1011,\'00000000\') OPE_NO from dual;
select length(t
Use FM (Fill Mode), e.g.
select to_char(1011,'FM00000000') OPE_NO from dual;
From that same documentation mentioned by EddieAwad:
Negative return values automatically contain a leading negative sign and positive values automatically contain a leading space unless the format model contains the MI, S, or PR format element.
EDIT: The right way is to use the FM modifier, as answered by Steve Bosman. Read the section about Format Model Modifiers for more info.