I need to fill in numbers with leading zeros (only 8 digits) to display. I am using oracle.
select to_char(1011,'00000000') OPE_NO from dual; select length(to_char(1011,'00000000')) OPE_NO from dual;
Instead of '00001011' I get '00001011'. Why am I getting extra spaces? What is the correct number formatting string to accomplish this?
PS I understand that I can just use trim() , but I want to better understand the formatting of numbers.
@Eddie: I already read the documentation. And yet I still do not understand how to get rid of leading gaps.
@David: Does this mean there is no way to use trim() ?
sql oracle
Ovesh Oct 01 '08 at 5:24 2008-10-01 05:24
source share