SQL Command to insert Chinese Letters

前端 未结 3 1912
北恋
北恋 2021-01-23 06:23

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

INSERT INTO table VALUES (\"玄真\") 

It shows ¿¿ in the table. W

3条回答
  •  轮回少年
    2021-01-23 06:54

    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 |
    |-------|
    |    玄真 |
    

提交回复
热议问题