Skip to Main Content
  • Questions
  • Print Pound Symbol from Oracle In Unix/DoS

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Snehasish.

Asked: October 11, 2011 - 3:01 am UTC

Last updated: October 11, 2011 - 11:41 am UTC

Version: 10.2.0.5.0

Viewed 1000+ times

You Asked

Hi,

One of the columns contains the £ charecter and we need to spool it out and send it. But while spooling in Unix It changes to #, I tried in DoS to check and there too it changes. Note we cant change the # to £ after spooling as other columns may contain # symbol. Can you please suggest a way.

SNEHASISH @USA >select gp_measure_name from X_DATA_KPI_MEASURE_DTLS where rownum < 10;

GP_MEASURE_NAME
----------------------------------------------------------------------------------------------------
EBITDA pre-leavers (£m)
EBITDA pre-leavers (£m)
EBITDA pre-leavers (£m)
EBITDA pre-leavers (£m)
EBITDA pre-leavers (£m)
EBITDA pre-leavers (£m)
EBITDA pre-leavers (£m)
EBITDA pre-leavers (£m)
EBITDA pre-leavers (£m)

9 rows selected.


IN DOS

GP_MEASURE_NAME
--------------------------------
EBITDA pre-leavers (úm)
EBITDA pre-leavers (úm)
EBITDA pre-leavers (úm)
EBITDA pre-leavers (úm)
EBITDA pre-leavers (úm)
EBITDA pre-leavers (úm)
EBITDA pre-leavers (úm)
EBITDA pre-leavers (úm)
EBITDA pre-leavers (úm)

9 rows selected.

Elapsed: 00:00:00.68

IN UNIX (HP_UX)

SNEHASISH @USA> select gp_measure_name from X_DATA_KPI_MEASURE_DTLS where rownum < 10;

GP_MEASURE_NAME
--------------------------------------------------------------------------------
EBITDA pre-leavers (#m)
EBITDA pre-leavers (#m)
EBITDA pre-leavers (#m)
EBITDA pre-leavers (#m)
EBITDA pre-leavers (#m)
EBITDA pre-leavers (#m)
EBITDA pre-leavers (#m)
EBITDA pre-leavers (#m)
EBITDA pre-leavers (#m)

9 rows selected.


Best Regards,
Snehasish Das.

and Tom said...

This has nothing to do with Oracle really.

This has everything to do with the characterset of the client, the characterset of your terminal program.

Is the characterset (NLS_LANG) of the client set appropriately.

Is the character set of your terminal program (nothing at all to do with Oracle - this is not an oracle setting!) set appropriately.


The default NLS_LANG in Unix is us7ascii - which cannot do the english pound - you'd need to set it. The default in windows is some windows character set (i forget which, I don't run oracle in windows) - and if it is different from the database character set - character set translation will take place and could be changing the pound sign to something else.

Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Deep s, October 11, 2011 - 11:35 am UTC

Yes..As Tom said, check your local NLS. Or a dirty solution is to use replace(str,'#','€'). But, this is dirty.
Tom Kyte
October 11, 2011 - 11:41 am UTC

the replace won't work if it is a NLS setting. Think about it.

When does the character get changed to a # during character set translation...

When it is on the way to the client...

Deep s, October 12, 2011 - 4:25 am UTC

Ah! I see, said the Blind man :)