select lpad('1234',4,'0') from dual select lpad('123',4,'0') from dual select lpad('23',4,'0') from dual select lpad('3',4,'0') from dual select nvl(lpad('',4,'0'),'0000') from dual