hi we want to use database li开发者_运维百科nk to connect a Database for operating the select,update or ... commands,our destination database is WE8ISO8859P1 and current database is AR8MSWIN1256 cahrset, but when we operate a command to view data,all NonEnglish characters appear odd wich we can not recognize the appeared text, also if we use convert function no change would make, please help us to view right charachters with our database link. thanks
it doesnt work with convert founction
select convert(menu_name,'US7ASCII','WE8ISO8859P1'), convert(menu_name,'ar8mswin1256','WE8ISO8859P1'), convert((convert(menu_name,'US7ASCII','WE8ISO8859P 1')),'ar8mswin1256','WE8ISO8859P1'), menu_name from T$R_MENU@"TO201.US.ORACLE.COM" WHERE MENU_ID=601011;
result is EU?iY ?C?ICa? OCOaI? E???? ?C?IC?? ?C??I? EU?iY ?C?ICa? OCOaI? E???? ?C?IC?? ?C??I?
Most of the time, when querying an Oracle database, you don't need a function to convert data from one character set to another: it is done automatically. The client requesting data will convert the strings to whatever character set it uses.
In your case, you're missing the non-english characters because they don't exist in WE8ISO8859P1!
You can use NVARCHAR2 instead of VARCHAR2 in your destination database to support unicode characters. NVARCHAR2 is specifically designed to handle such strings without modifying the database character set. See this SO question for differences between VARCHAR2 and NVARCHAR2.
精彩评论