Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Saving text with special characters in Oracle Database

2678604May 22 2014 — edited May 22 2014

Hi,

Im new in this forum. Last days I have been trying to create a TABLE able to save large texts with special characters. I want to save catalan texts which has characters like àáèéïíóòúÀÁ...

I choosed UTF-8 as the charset of the database in order to be able to save this characters.

SQL> select * from v$nls_parameters where parameter like '%CHARACTERSET%';

PARAMETER

----------------------------------------------------------------

VALUE

----------------------------------------------------------------

NLS_CHARACTERSET

AL32UTF8

NLS_NCHAR_CHARACTERSET

AL16UTF16

My Oracle Version is:

SQL> select * from v$version;

BANNER

--------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

PL/SQL Release 11.2.0.1.0 - Production

CORE 11.2.0.1.0 Production

TNS for Linux: Version 11.2.0.1.0 - Production

NLSRTL Version 11.2.0.1.0 - Production

I created the next test table:

CREATE TABLE sdocumental.testchars (

  name VARCHAR2(100) NOT NULL,

  nameutf NVARCHAR2(100) NOT NULL)

STORAGE (INITIAL 50K);

I insert into the table strings using three diferent methods:

INSERT INTO testchars VALUES ('presidència', 'presidència');

INSERT INTO testchars VALUES (N'presidència', N'presidència');

INSERT INTO testchars VALUES (TO_NCHAR('presidència'), TO_NCHAR('presidència'));

And I always get data lost strings:

SQL> select * from sdocumental.testchars;

NAME

--------------------------------------------------------------------------------

NAMEUTF

--------------------------------------------------------------------------------

presid??ncia

presid??ncia

presid??ncia

presid??ncia

presid??ncia

presid??ncia

My terminal uses the utf-8 codification too.

I searched through google but I do not find the solution. Anyone can help me? Thanks a lot!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 19 2014
Added on May 22 2014
1 comment
4,904 views