Home » SQL & PL/SQL » SQL & PL/SQL » How to retain special characters while extracting from DB in UNIX
How to retain special characters while extracting from DB in UNIX [message #590234] Tue, 16 July 2013 03:18 Go to next message
BlackJack@13
Messages: 4
Registered: June 2013
Junior Member
Hi All,

In my DB there are special characters are stored like "Świętochłowice".
So in Unix script while extracting these characters, I have used
export LANG="universal.UTF-8" in order to make it English. which works fine.

But my question is how to retain this special character intact as, it is in DB?

So in UNIX script
export LANG="universal.UTF-8"
sqlplus -s  uname/pwd@hostname/schema  << ENDSQL | sed -e "s/Connected\.//" -e "/^$/d"
set pagesize 0 feedback off verify off heading off echo off  serveroutput on size 10000
spool /path/out.txt
Select name from tablename where is=12; 
spool off;
exit
ENDSQL


Output is "Swietochlowice" (makes sense),but how to get the output as "Świętochłowice" which is in DB??

I have tried different NLS_LANG option, but no success. So, wondering if anyone else could help me over here?
Re: How to retain special characters while extracting from DB in UNIX [message #590235 is a reply to message #590234] Tue, 16 July 2013 03:30 Go to previous messageGo to next message
dariyoosh
Messages: 531
Registered: March 2009
Location: Iran / France
Senior Member
Hi,

What it the default characterset configured on the server and the one configured
on the client? Are both server and client on the same physical machine?

Regards,
Dariyoosh
Re: How to retain special characters while extracting from DB in UNIX [message #590236 is a reply to message #590234] Tue, 16 July 2013 03:32 Go to previous messageGo to next message
Michel Cadot
Messages: 58632
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Barbara gave you a complete answer with a demonstration in your previous topic, why didn't you feedback and even thank her for her time and work?

Regards
Michel
Re: How to retain special characters while extracting from DB in UNIX [message #590241 is a reply to message #590235] Tue, 16 July 2013 04:13 Go to previous messageGo to next message
BlackJack@13
Messages: 4
Registered: June 2013
Junior Member
hey Dariyoosh,

I believe, My client character set is AL16UTF16 and my server character set is AL32UTF8.
let me know, if I did something wrong to figure it out client and server character set?

SELECT * FROM NLS_DATABASE_PARAMETERS;
 
--NLS_CHARACTERSET	AL32UTF8
--NLS_NCHAR_CHARACTERSET AL16UTF16


No, client and servers are different physical machines but OS are same(Linux) in both machines.

[Updated on: Tue, 16 July 2013 04:21]

Report message to a moderator

Re: How to retain special characters while extracting from DB in UNIX [message #590391 is a reply to message #590241] Wed, 17 July 2013 10:29 Go to previous messageGo to next message
BlackJack@13
Messages: 4
Registered: June 2013
Junior Member
Is there any one who can resolve this issue ???
Re: How to retain special characters while extracting from DB in UNIX [message #590395 is a reply to message #590391] Wed, 17 July 2013 11:21 Go to previous message
Michel Cadot
Messages: 58632
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Nope unless you thank people that helped you.
You have nothing to do to disdainful and contemptuous people like you.

Regards
Michel

[Updated on: Wed, 17 July 2013 11:21]

Report message to a moderator

Previous Topic: Dynamic SQL error : Want to define dynamic type for a variable in Oracle 10g
Next Topic: problem with having clause
Goto Forum:
  


Current Time: Thu Jul 31 08:37:02 CDT 2014

Total time taken to generate the page: 0.14795 seconds