Home » Other » Training & Certification » code to display string of numbers in words(Ex: 321 as Three Two One); (Please don't use to_d
icon9.gif   code to display string of numbers in words(Ex: 321 as Three Two One); (Please don't use to_d [message #320177] Wed, 14 May 2008 04:36 Go to next message
amritaseema
Messages: 47
Registered: January 2008
Member
Hi All,
i want a code to display string of numbers in words(Ex: 321 as Three Two One); (Please don't use to_date function)

I tried using to_date and showing the o/p till 99...
DECLARE
v_number VARCHAR2 (20);
BEGIN
SELECT TO_CHAR (TO_DATE (&n, 'J'), 'JSP')
INTO v_number
FROM DUAL;

DBMS_OUTPUT.put_line ('The number is :' || v_number);
END;

bt now i want it without using any functions.plzz help me out.

Thanks in adavance
Seema
Re: code to display string of numbers in words(Ex: 321 as Three Two One); (Please don't use to_d [message #320180 is a reply to message #320177] Wed, 14 May 2008 04:40 Go to previous messageGo to next message
Michel Cadot
Messages: 68637
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Write your own code.

Regards
Michel
icon9.gif  Re: code to display string of numbers in words(Ex: 321 as Three Two One); (Please don't use to_d [message #320196 is a reply to message #320180] Wed, 14 May 2008 05:10 Go to previous messageGo to next message
amritaseema
Messages: 47
Registered: January 2008
Member
i am not getting it....
i got it using the to_char and to_date function as i mentioned above...
Re: code to display string of numbers in words(Ex: 321 as Three Two One); (Please don't use to_d [message #320199 is a reply to message #320196] Wed, 14 May 2008 05:17 Go to previous messageGo to next message
Michel Cadot
Messages: 68637
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes but if you don't want to use built-in functions then you have to write your own code.

Regards
Michel
Re: code to display string of numbers in words(Ex: 321 as Three Two One); (Please don't use to_d [message #320260 is a reply to message #320196] Wed, 14 May 2008 07:52 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
amritaseema wrote on Wed, 14 May 2008 12:10
i am not getting it....
i got it using the to_char and to_date function as i mentioned above...

I am not getting it either.
Why don't you want to use the only appropriate functions available?
Re: code to display string of numbers in words(Ex: 321 as Three Two One); (Please don't use to_d [message #320312 is a reply to message #320260] Wed, 14 May 2008 11:45 Go to previous messageGo to next message
Michel Cadot
Messages: 68637
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Why don't you want to use the only appropriate functions available?

Because teacher asked to do so. Wink

Regards
Michel
Re: code to display string of numbers in words(Ex: 321 as Three Two One); (Please don't use to_d [message #320580 is a reply to message #320312] Thu, 15 May 2008 10:05 Go to previous messageGo to next message
amritaseema
Messages: 47
Registered: January 2008
Member
because i want to know how we can write it without using prdefine function... Confused Confused Confused Confused
Re: code to display string of numbers in words(Ex: 321 as Three Two One); (Please don't use to_d [message #320588 is a reply to message #320580] Thu, 15 May 2008 10:25 Go to previous message
Michel Cadot
Messages: 68637
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Well, what did you think/find/try till now?

Regards
Michel
Previous Topic: program to print the number of occurrence of a particular letter in a word.
Next Topic: pl/sql block to determine the top employees
Goto Forum:
  


Current Time: Tue Apr 16 18:29:24 CDT 2024