Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: NUMBER TO WORDS

Re: NUMBER TO WORDS

From: Alex Filonov <afilonov_at_pro-ns.net>
Date: Sat, 25 Mar 2000 04:24:02 GMT
Message-ID: <8bhf0n$erc$1@nnrp1.deja.com>


In article <022502e0.fbda2274_at_usw-ex0102-013.remarq.com>, denunez <denunezNOdeSPAM_at_uacj.mx.invalid> wrote:
> I NEED TO KNOW HOW CAN I CHANGE DE LANGUAGE OF THE RESULT OF
> THIS SQL:
> select to_char(to_date(123,'J'),'jsp') from dual RETURNS
> one hundred twenty-three
> I WANT THE RESULT IN ANOTHER LANGUAGE LIKE SPANISH: CIENTO
> VEINTI TRES
> WHAT I NEED TO CHANGE ON THE CLIENT OR ON THE SERVER TANK YOU
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion
Network *
> The fastest and easiest way to search and participate in Usenet -
Free!
>

OK, Here I am again.

According to Oracle NLS documentation (you can look it up on Oracle Technology network), only names of days and months are translated to NLS_LANGUAGE. SP format always returns results in English. So the only way for you to get you result is to convert it using something like this:

select replace(

         replace(
           replace(
           ...................
             replace(to_date(/* whatever date you need */, 'YYYYSP'),
                     'ONE', 'UNO'),
           ...................
                    'HUNDRED', 'CIENTO'),
                  'TWENTY', 'VIENTO'),
                'THREE', 'TRES')

from dual. There are problems, of course. You may want to have CIENTO, not UNO CIENTO. And gramatic structure may be different, but that I don't know, I don't know spanish at all. You might end up with some PL/SQL stored function to handle all possible conversions.

>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Mar 24 2000 - 22:24:02 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US