库A 字符集 ZHS16GBK
库B 字符集 UTF8
库A CREATE TABLE FROM 库B@DBLINK
查询库A 表中文乱码。
解决方法 使用 UTL_RAW.CAST_TO_RAW,UTL_RAW.CAST_TO_VARCHAR2 进行无类型转迁。
库B 建 VIEW :
CREATE OR REPLACE VIEW VIEW_RAW_TEST AS SELECT ID,UTL_RAW.CAST_TO_RAW(NAME) NAME FROM 库B.表
库A 建 DBLINK
CREATE DATABASE LINK LINK_TEST CONNECT TO TEST IDNENTIFIED BY TEST USING 'ORANAMES.ORA';
库A 建 VIEW
CREATE OR REPLACE VIEW VIEW_VCHAR_TEST AS SELECT ID,UTL_RAW.CAST_TO_VARCHAR2(NAME) NAME FROM 库B.表@LINK_TEST;
网友评论