The SQL code bellow will make some english spelled number (up to 9 digital) into possible. Read this in one of interview questions, and changed the Jsp version to Ffsp
Hope this ugly code can be replaced by 11gR2 new functions :)
what we really need is the function format below:
select to_char(rownum,'L99sp') from dual connect by level<=10;
SQL> select to_timestamp(lpad(rownum,9,'0'),'FF9') from dual connect by level<=10;
TO_TIMESTAMP(LPAD(ROWNUM,9,'0'),'FF9')
----------------------------------------------------------------------
01-MAR-09 12.00.00.000000001 AM
01-MAR-09 12.00.00.000000002 AM
01-MAR-09 12.00.00.000000003 AM
01-MAR-09 12.00.00.000000004 AM
01-MAR-09 12.00.00.000000005 AM
01-MAR-09 12.00.00.000000006 AM
01-MAR-09 12.00.00.000000007 AM
01-MAR-09 12.00.00.000000008 AM
01-MAR-09 12.00.00.000000009 AM
01-MAR-09 12.00.00.000000010 AM
10 rows selected.
SQL> select to_char(to_timestamp(lpad(rownum,9,'0'),'FF9'),'Ffsp') from dual connect by level<=10;
TO_CHAR(TO_TIMESTAMP(LPAD(ROWNUM,9,'0'),'FF9'),'FFSP')
----------------------------------------------------------------------
One
Two
Three
Four
Five
Six
Seven
Eight
Nine
Ten
10 rows selected.
没有评论:
发表评论