Long time ago I found this beauty in some place...
Code:
SQL> create or replace function num2word(num in number)
2 return varchar2
3 as
4 begin
5 return to_char(to_date(num, 'j'),'JSPTH');
6 END;
SQL> /
Function created.
SQL> select num2word(2975) from dual;
NUM2WORD(2975)
--------------------------------------------------------------------------------
TWO THOUSAND NINE HUNDRED SEVENTY-FIFTH
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
SQL> set echo on feedba on
SQL> get cr_fn
1 create or replace function num2word(num in number)
2 return varchar2
3 as
4 begin
5 return to_char(to_date(num, 'j'),'JSPTH');
6* END;
7 /
Function created.
SQL> select num2word(987654321) from dual;
select num2word(987654321) from dual
*
ERROR at line 1:
ORA-01854: julian date must be between 1 and 5373484
ORA-06512: at "SYS.STANDARD", line 167
ORA-06512: at "OPS$ORACLE.NUM2WORD", line 5
SQL> select num2word(987654321) from dual;
select num2word(987654321) from dual
*
ERROR at line 1:
ORA-01854: julian date must be between 1 and 5373484
ORA-06512: at "SYS.STANDARD", line 167
ORA-06512: at "OPS$ORACLE.NUM2WORD", line 5
$987,654,321 seams too much for a paycheck.
If you are doing that much please let me know how to apply for a job there.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Bookmarks