Home » SQL & PL/SQL » SQL & PL/SQL » Pound (£) sign in Oracle 8i
Pound (£) sign in Oracle 8i [message #244754] Thu, 14 June 2007 01:04 Go to next message
kanis
Messages: 61
Registered: November 2006
Member
Hi,

I am in a need of generating pound (£) sign.

e.g
select 'Amount is '||chr(164)||'2.40' from dual
results
Amount is $2.40

Same way I need the result Amount is £2.40

Regards,
Kanis
Re: Pound (£) sign in Oracle 8i [message #244770 is a reply to message #244754] Thu, 14 June 2007 01:35 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
If pound is your currency, you just have to use:
SQL> select 'Amount is '||to_char(2.4,'fmL990.00') c from dual;
C
---------------------------
Amount is £2.40

Otherwise you have:
SQL> select ascii('£') from dual;
ASCII('£')
----------
       163

Regards
Michel
Re: Pound (£) sign in Oracle 8i [message #244772 is a reply to message #244754] Thu, 14 June 2007 01:39 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
1. set the currency to pounds:
alter session set nls_currency = '£';

2. Select your number, and add a to_char including the 'L' number format element:
SQL> alter session set nls_currency = '£';

Session altered.

SQL>
SQL> select to_char(1/3,'L990D99') x
  2  from dual
  3  /

X
-----------------
            £0.33


MHE
Previous Topic: Composite Primary Key & dup_val_on_index (2 merged)
Next Topic: select single record not using where clause
Goto Forum:
  


Current Time: Thu Dec 05 16:37:28 CST 2024