用Oracle的编码转换的函数Convert实现,测试后可行.
SQL> select *
2 from (select ‘abcd‘ c1 from dual
3 union all
4 select ‘ab测试cd‘ c1 from dual)
5 where c1 <> CONVERT(c1, ‘US7ASCII‘, ‘ZHS16GBK‘);
C1
--------
ab测试cd
CONVERT函数说明:
CONVERT(inputstring,dest_charset,source_charset)
inputstring:要转换的字符串
dest_charset:目标字符集
source_charset:原字符集