• Certifications

  • Moderator at

  • Member at

  • Archives

  • December 2017
    M T W T F S S
    « Sep    
     123
    45678910
    11121314151617
    18192021222324
    25262728293031
  • Recent Posts

  • Blog Stats

    • 64,420 hits
  • Enter your email address to follow this blog and receive notifications of new posts by email.

Archive for the ‘Functions In oracle’ Category

Spell number In Indian Currency System Using Function (Number into words)

Posted by sriram on May 20, 2011


As we all know We can convert number into words Using ‘Jsp’ format string in to_char function.

ind> select to_char(to_date(‘250′,’J’),’JSP’) from dual;

TO_CHAR(TO_DATE(‘
—————–
TWO HUNDRED FIFTY

1 row selected.

ind> select to_char(to_date(‘259′,’J’),’JSP’) from dual;

TO_CHAR(TO_DATE(‘259’,
———————-
TWO HUNDRED FIFTY-NINE

1 row selected.

ind> select to_char(to_date(‘9999′,’J’),’JSP’) from dual;

TO_CHAR(TO_DATE(‘9999′,’J’),’JSP’)
————————————–
NINE THOUSAND NINE HUNDRED NINETY-NINE

1 row selected.

But It has some limitations….See
ind> select to_char(to_date(‘250.25′,’J’),’JSP’) from dual;
select to_char(to_date(‘250.25′,’J’),’JSP’) from dual
*
ERROR at line 1:
ORA-01830: date format picture ends before converting entire input string

ind> select to_char(to_date(‘9999999999.99′,’J’),’JSP’) from dual;
select to_char(to_date(‘9999999999.99′,’J’),’JSP’) from dual
*
ERROR at line 1:
ORA-01854: julian date must be between 1 and 5373484

We can avoid this By creating one Function .
This is similar to Ask Tom Spell number

ind> select spell_number(‘9999999999.99’) from dual;

SPELL_NUMBER(‘9999999999.99’)
——————————————————————————–
nine billion nine hundred ninety-nine million nine hundred ninety-nine thousand
nine hundred ninety-nine

1 row selected.

ind> select into_rupees(‘9999999999.99’) from dual;

INTO_RUPEES(‘9999999999.99’)
——————————————————————————–
Nine Arab Ninety-Nine Crore Ninety-Nine Lakh Ninety-Nine Thousand Nine Hundred N
inety-Nine and Paise Ninety-Nine.

You can find this into_rupees script at Indian Rupees

Thank you 🙂

Advertisements

Posted in Functions In oracle | 7 Comments »

 
Puddintopia

The Ramblings and Ravings Of Author Jason A. Rust

So Many Oracle Manuals, So Little Time

“Books to the ceiling, Books to the sky, My pile of books is a mile high. How I love them! How I need them! I'll have a long beard by the time I read them”—Lobel, Arnold. Whiskers and Rhymes. William Morrow & Co, 1988.

flashdba

Oracle databases, storage and the high-performance world of flash memory

jarneil

The thoughts of Jason Arneil

Frits Hoogland Weblog

IT Technology; Oracle, linux, TCP/IP and other stuff I find interesting

OraStory

Dominic Brooks on Oracle Performance, Tuning, Data Quality & Sensible Design ... (Now with added Sets Appeal)

Martins Blog

Trying to explain complex things in simple terms

Carlos Sierra's Tools and Tips

Tools and Tips for Oracle Performance and SQL Tuning

Talip Hakan Ozturk's ORACLE BLOG

The secret of success is at your fingertips!...

Martin Widlake's Yet Another Oracle Blog

Oracle performance, Oracle statistics and VLDBs

Richard Foote's Oracle Blog

Focusing Specifically On Oracle Indexes, Database Administration and Some Great Music

Oracle Scratchpad

Just another Oracle weblog

Oracle DBA Blog

Procedures, learnings and fixes encountered by a Junior DBA

Oracle ACE Director Kai Yu's Oracle Blog

Share Oracle Tips and Tricks and Related News

Online Identity & Access Management

One Stop Shop for Identity & Access Management

Uwe Hesse

about Database Technology

Oracle database internals by Riyaj

Discussions about Oracle performance tuning, RAC, Oracle internal & E-business suite.

WordPress.com

WordPress.com is the best place for your personal blog or business site.

Kamran Agayev's Oracle Blog

Oracle Certified Master

%d bloggers like this: