Search code examples
unicodeoracle-sqldevelopernvarchar

SQL Command to insert Chinese Letters


I have a database with one column of the type nvarchar. If I write

INSERT INTO table VALUES ("玄真") 

It shows ¿¿ in the table. What should I do?

I'm using SQL Developer.


Solution

  • Use single quotes, rather than double quotes, to create a text literal and for a NVARCHAR2/NCHAR text literal you need to prefix it with N

    SQL Fiddle

    Oracle 11g R2 Schema Setup:

    CREATE TABLE table_name ( value NVARCHAR2(20) );
    
    INSERT INTO table_name VALUES (N'玄真');
    

    Query 1:

    SELECT * FROM table_name
    

    Results:

    | VALUE |
    |-------|
    |    玄真 |