Unicode character in Oracle database

3.8k Views Asked by At

Currently I'm working on Oracle database and want to create a table schema that can accept Unicode character with below query. When i insert the characters they inserted successfully but when i select from table it results as ????. The characters are in Urdu language. As per my requirement i have to create a table schema which can accept English and Urdu characters at the same time. Please help

CREATE TABLE product_information 
( product_id          NUMBER(6) 
, product_name        NVARCHAR2(100) 
, product_description VARCHAR2(1000));
INSERT INTO product_information 
(product_id,product_name,product_description) VALUES (10,'آسان','طاقت')

Unicode table query

Database Characterset

1

There are 1 best solutions below

2
On

Unicode gets stored in NCHAR and NVARCHAR character but while selecting it will return ??? if NLS_CHARACTERSET used for normal CHAR and NVARCHAR is not UTF8 encoded. We solve this issue by converting the character set of the database(NLS CHARACTERSET and NLS_NCHAR_CHARACTERSET to AL16UTF16) using DMU tool provided by Oracle. Its very handy tool and take care of character set migration. You will need to have a backup and their need to reserve down as this activity required database restart. Once restarted you will be able to view UNICODE.For reference. https://docs.oracle.com/database/121/DUMAG/ch1overview.htm#DUMAG105