Home » SQL & PL/SQL » SQL & PL/SQL » Converting currency from $ to £  () 1 Vote
icon5.gif  Converting currency from $ to £ [message #120210] Wed, 18 May 2005 07:58 Go to next message
Fooman
Messages: 17
Registered: April 2005
Location: Germany
Junior Member
How do you convert a column, Order_Total, from it being in dollar to british pound?

Thx in Advance

F
Re: Converting currency from $ to £ [message #120215 is a reply to message #120210] Wed, 18 May 2005 08:55 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
update table set column = column * conversion_value;
Re: Converting currency from $ to £ [message #120218 is a reply to message #120210] Wed, 18 May 2005 09:08 Go to previous messageGo to next message
Fooman
Messages: 17
Registered: April 2005
Location: Germany
Junior Member
just re-read my original message, and maybe i wasnt too clear

i want to change the 'value' in a column not the format of the column itself

my current idea is, using the dual table:

select TO_CHAR (2000, '9G999D99C', 'nls_numeric_characters = ''.,''
   nls_iso_currency = united kingdom')
from dual;

it returns this:
 nls_iso_currency = united kingdom') from dual
                                          *
ERROR at line 2:
ORA-12702: invalid NLS parameter string used in SQL function

but it i change the 'united kingdom' from line 2 to 'japan'

it works and return the following:
TO_CHAR(2000,'9G
----------------
     2,000.00JPY



Re: Converting currency from $ to £ [message #120246 is a reply to message #120218] Wed, 18 May 2005 10:26 Go to previous messageGo to next message
dmitry.nikiforov
Messages: 723
Registered: March 2005
Senior Member
SQL> select TO_CHAR (2000, '9G999D99C', 'nls_numeric_characters = ''.,''
  2     nls_iso_currency = ''united kingdom''')
  3  from dual;

TO_CHAR(2000,'9G
----------------
     2,000.00GBP


Rgds.
Re: Converting currency from $ to £ [message #120258 is a reply to message #120246] Wed, 18 May 2005 10:45 Go to previous messageGo to next message
dmitry.nikiforov
Messages: 723
Registered: March 2005
Senior Member
Also you can use nls_currency:

SQL> select TO_CHAR (2000, 'L9G999D99', 'nls_numeric_characters = ''.,'' nls_currency = ''#''')
  2  from dual
  3  /

TO_CHAR(2000,'L9G99
-------------------
          #2,000.00



Rgds.



icon14.gif  Re: Converting currency from $ to £ [message #120343 is a reply to message #120258] Thu, 19 May 2005 03:53 Go to previous message
Fooman
Messages: 17
Registered: April 2005
Location: Germany
Junior Member
Thanks
Previous Topic: Know the End of the Month
Next Topic: Urgent help
Goto Forum:
  


Current Time: Thu Sep 04 01:49:41 CDT 2025