Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cant get the '£' sign

Status
Not open for further replies.

teknikalbody

Programmer
Mar 2, 2003
35
GB
Hi
Can someone tell me how I can get the £ sign to display because at the moment its returning #. I have tried
chr(163) but the same thing.

Some details form the db if helps are:

NLS_LANGUAGE = AMERICAN
NLS_TERRITORY = AMERICA
NLS_CURRENCY = $

NLS_CHARACTERSET = US7ASCII
 
Teknikalbody,

A simple method without changing significant numbers of features in your database appears below:
Code:
select to_char(12345.67,'L999,999.99') from dual;

$12,345.67

alter session set nls_currency = '£';

Session altered.

select to_char(12345.67,'L999,999.99') from dual;

£12,345.67

The "L" symbol in your format mask means "use the local currency symbol."

Does this solution satisfactorily meet your needs?

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 16:18 (19Nov04) UTC (aka "GMT" and "Zulu"),
@ 09:18 (19Nov04) Mountain Time
 
Mustafa,

No, it returns #12,345.67.

Is there anything else I could try ?

Thanks
 
Teknikalbody,

As you may already be aware, these are the ASCII bit configurations of our two characters in question:
Code:
"#" = 00100011
"£" = 10100011
We are just one high-order bit off. This can result from your client PC machine's "code page" value instead of being an Oracle issue. For example, the Microsoft code page on my PC is "1252", which supports "£". To determine your code page setting, you do the following beginning from a Windows OS prompt:
Code:
regedit
(then expand as follows):
HKEY_LOCAL_MACHINE...SYSTEM...CurrentControlSet...Control...NLS...CodePage, then scroll to the end of the list and check the value of the "ACP" entry...mine reads "1252"
If your value is different and you wish to isolate whether the setting is your problem, then you can <right-click> on ACP...Modify...Value Data, change it to 1252 [OK]. (You can always change the value back to its original setting if you do not want 1252.) Then retry my working code, above. If it doesn't work, you might want to try a re-boot since I'm not positive whether a code-page change takes effect with or without a re-boot.

Let us know your findings.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 16:52 (19Nov04) UTC (aka "GMT" and "Zulu"),
@ 09:52 (19Nov04) Mountain Time
 
Teknikalbody,

Then the next thing I would try is to connect to other Oracle databases to which you have access and which have character sets that differ from US7ASCII (since, as we already discovered, we need the high-order 8th bit to display the "£"). Try the above "ALTER SESSION..." command along with the "select to_char(12345.67,'L999,999.99') from dual;" and post your results. Remember, I was successful with my default "WE8ISO8859P1" character set.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 09:44 (22Nov04) UTC (aka "GMT" and "Zulu"),
@ 02:44 (22Nov04) Mountain Time
 
Hi Mufasa,

Unfortunately I only have access to the current and one other DB and that also is US7ASCII.


 
Can you find out from your DBA if there is any database available that does not use US7ASCII? If there is such, then request the DBA run our test query. An alternative is to install Oracle on your PC, ensuring that you use "WE8ISO8859P1" as your character set.

Let us know,

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 16:20 (22Nov04) UTC (aka "GMT" and "Zulu"),
@ 09:20 (22Nov04) Mountain Time
 
Hi Mufasa,

Sorry, a case of me being silly, I just tried the "ALTER SESS.." command in sqlPlus (previously I was using TOAD!)
it works great.

Taking this opportunity of thanking you for all your help.

Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top