JiboOne
JiboOne

Reputation: 1548

UTF-8 characters in Oracle

I want to insert UTF-8 characters in Oracle 12 database using INSERT statement. I'm using PL/SQL Developer Tool (version 8).

When I run this INSERT statement

INSERT INTO my_table (my_column) VALUES ('ტექსტი');

and then run the SELECT statement

SELECT my_column FROM my_table

it returns question marsk

??????

But when I insert my UTF-8 text manually (using copy & paste) into the table and then run the same SELECT statement it returns data correctly

ტესქტი

Should I run any command before inserting UTF-8 character using insert statement?

Upvotes: 2

Views: 6357

Answers (1)

peter.hrasko.sk
peter.hrasko.sk

Reputation: 4141

Prefix your string literal with n as in

INSERT INTO my_table (my_column) VALUES (n'ტექსტი');

That will tell your Oracle DB that the incoming value is of nvarchar2 data type.

Upvotes: 9

Related Questions