Monday, 9 May 2011

A workaround to force keeping the leading 0 is to use a formula instead of a static string.

CODE
DEPTNO
10
20
30
40
SQL> select to_char(deptno,'FM000000000000000') deptno from dept;
DEPTNO
----------------
000000000000010
000000000000020
000000000000030
000000000000040

No comments:

Post a Comment