Home » Infrastructure » Linux » Inserting special characters into table
Inserting special characters into table [message #350618] Thu, 25 September 2008 10:57 Go to next message
rolex.mp
Messages: 161
Registered: February 2007
Senior Member
I am using Oracle 10.2.0.2 on Solaris SPARC

We had issues while inserting special characters into a table.
The character set of the database is AL32UTF8.

When I insert values from Windows using Oracle 10g client I am able to insert special characters but when I do the same from Linux I was not able to since the data became corrupt.
NLS_LANG was not set in Linux and that was the reason. I did set the
NLS_LANG to American_America.AL32UTF8 and tried

SQL> insert into sample values('Santamarķa');
ERROR:
ORA-01756: quoted string not properly terminated
Santamarķa


I did set NLS_LANG to American_America.WE8ISO8859P1 in Windows and tried inserting the data

SQL> insert into sample values('Santamarķa');
1 row created.
SQL> commit;
Commit complete.


Did the same in Linux and tried

SQL> insert into sample values('Santamarķa');
1 row created.
SQL> commit;
Commit complete.


Now tried querying the data from Windows

SQL> select * from sample;
NAME
-----------------------------------------------------------------------------
Santamarķa
SantamarŻa


and then in Linux

SQL> select * from sample;
NAME
--------------------------------------------------------------------------------
Santamar”a
Santamarķa


The data I inserted in Linux appears corrupted in Windows and the vice versa.

What should the NLS_LANG variable be set to ?
Re: Inserting special characters into table [message #350625 is a reply to message #350618] Thu, 25 September 2008 11:04 Go to previous messageGo to next message
Michel Cadot
Messages: 59775
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
I did set the NLS_LANG to American_America.AL32UTF8

But is your client talking with this character set?

Quote:
What should the NLS_LANG variable be set to ?

To the character set your client (Linux) uses.

Regards
Michel
Re: Inserting special characters into table [message #350627 is a reply to message #350618] Thu, 25 September 2008 11:32 Go to previous message
rolex.mp
Messages: 161
Registered: February 2007
Senior Member
Linux character set is

LC_CTYPE=en_GB.UTF-8

When I set NLS_LANG to American_America.AL32UTF8 and try inserting special characters into table I get an error.

When I set NLS_LANG to American_America.WE8ISO8859P1 and try the same , it works but when I query the data from Windows it is showing differently.


Previous Topic: Can't open DISPLAY
Next Topic: Available space on directory.
Goto Forum:
  


Current Time: Tue Nov 25 19:44:21 CST 2014

Total time taken to generate the page: 0.09170 seconds