sqloracle-databasecharacter-encodingmissing-symbols

Oracle column contents displayed as "?", how to fix it?


In column COMMENTS of dba_col_comments table some symbols appear as "?". Probably these are replaced Chinese symbols.

PL/SQL Developer and SQLPlus show the same results:

SQL> SELECT * FROM dba_col_comments WHERE table_name='XX' AND COLUMN_NAME='OO';

OWNER   TABLE_NAME  COLUMN_NAME               COMMENTS
------- ---------- -------------- -------------------------  
GAME    XX          OO             1?????????2?????????????


SQL> select userenv('language') from dual;

USERENV('LANGUAGE')
----------------------------------
SIMPLIFIED CHINESE_CHINA.AL32UTF8

How to know actual symbols, which replaced by the question marks?


Solution

  • If your db is storing the ? literally then I am not sure, but you can get the ascii value of the second character in comments with something like below

    SELECT ASCII(SUBSTR(COMMENTS,2,1)) FROM DBA_COL_COMMENTS WHERE TABLE_NAME='XX' AND COLUMN_NAME='OO';
    

    If you want to see third, use 3 in substr parameter.

    If you are getting result as 63 (ascii of ?) then we need to find another way to see this. Check and let us know.