從utf8轉到US7ASCII
資料庫A為UTF8字符集。
資料庫B為US7ASCII字符集。
資料庫A端,根據基表建立檢視,使用到utl_raw.cast_to_raw函式:
CREATE or replace VIEW B$APP_CLOT_INFO AS SELECT
ID,
GMT_CREATE,
utl_raw.cast_to_raw(CREATOR) AS CREATOR,
GMT_MODIFIED,
utl_raw.cast_to_raw(MODIFIER) AS MODIFIER,
IS_DELETED,
utl_raw.cast_to_raw(NAME) AS NAME,
SQL,
utl_raw.cast_to_raw(OBJ_CLASS_NAME) AS OBJ_CLASS_NAME,
utl_raw.cast_to_raw(KEY_NAME) AS KEY_NAME,
utl_raw.cast_to_raw(PARENT) AS PARENT,
utl_raw.cast_to_raw(GROUPS) AS GROUPS,
utl_raw.cast_to_raw(SCHEDULE_STR) AS SCHEDULE_STR,
LOAD_ORDER,
utl_raw.cast_to_raw(COMMENTS) AS COMMENTS
FROM APOLLO.APP_CLOT_INFO;
資料庫B端:
SELECT ID,
GMT_CREATE,
convert(utl_raw.cast_to_varchar2(CREATOR), 'zhs16gbk', 'utf8') AS CREATOR,
GMT_MODIFIED,
convert(utl_raw.cast_to_varchar2(MODIFIER), 'zhs16gbk', 'utf8') AS MODIFIER,
IS_DELETED,
convert(utl_raw.cast_to_varchar2(NAME), 'zhs16gbk', 'utf8') AS NAME,
SQL,
convert(utl_raw.cast_to_varchar2(OBJ_CLASS_NAME),
'zhs16gbk',
'utf8') AS OBJ_CLASS_NAME,
convert(utl_raw.cast_to_varchar2(KEY_NAME), 'zhs16gbk', 'utf8') AS KEY_NAME,
convert(utl_raw.cast_to_varchar2(PARENT), 'zhs16gbk', 'utf8') AS PARENT,
convert(utl_raw.cast_to_varchar2(GROUPS), 'zhs16gbk', 'utf8') AS GROUPS,
convert(utl_raw.cast_to_varchar2(SCHEDULE_STR), 'zhs16gbk', 'utf8') AS SCHEDULE_STR,
LOAD_ORDER,
convert(utl_raw.cast_to_varchar2(COMMENTS), 'zhs16gbk', 'utf8') AS COMMENTS
FROM ;
可以解決亂碼問題。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22034023/viewspace-674002/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle將字元編碼從GBK轉到UTF8,如何操作比較穩妥?Oracle字元
- Oracle 字符集從GBK升級到Utf8Oracle
- 從HTML到XML (轉)HTMLXML
- 從IT職位到IT角色(轉)
- 從Excel到ERP(轉)Excel
- ANSI與UTF8之間的轉換!std::string與UTF8之間的轉換
- C++ UTF8 互轉 UnicodeC++Unicode
- 從free(p)到delete[]p (轉)delete
- 從音樂到軟體 (轉)
- US7ASCII字符集轉換為ZHS16GBKASCII
- 從IIS轉到SQL資料庫安全(轉)SQL資料庫
- Linux下轉換字符集(UTF8轉換)Linux
- Python從入門到轉行Python
- 從程式設計師到CEO(轉)程式設計師
- [轉]SqlServe到PG遷移錯誤:無效的編碼序列”UTF8″:0x00SQL
- php的漢字轉換: Unicode(UTF8)->GBK (轉)PHPUnicode
- C# UTF8字串轉漢字C#字串
- 從 Godaddy 轉移域名到 NamesiloGo
- 從 pthread 轉換到 std::threadthread
- 領導力:從個人到團隊(轉)
- 從DTFT到DFS,從DFS到DFT,從DFT到FFT,從一維到二維FFT
- C++ 將中文轉為UTF8 code(URL碼)C++
- 從DBA到Oracle Applications DBA的轉變過程 (轉)OracleAPP
- 從0到1玩轉執行緒池執行緒
- JWT簡介:從Session到Token的轉變JWTSession
- 從 PHP 轉到 Node.js 的那些事PHPNode.js
- 從學生到程式設計師(二) (轉)程式設計師
- Java學習從入門到精通(3)(轉)Java
- Java學習從入門到精通(2)(轉)Java
- 專案管理:從工藝到品質(轉)專案管理
- 從墨子用人到團隊溝通管理(轉)
- 將資料從文字匯入到mysql(轉)MySql
- 從後臺到webshell的一點思路(轉)Webshell
- 【轉】 oracle 字符集 AL32UTF8、UTF8Oracle
- MySQL字符集設定及字元轉換(latin1轉utf8)MySql字元
- [轉]從0到1教你設計業務系統
- WIX是如何從CRUD轉換到Event Sourcing?
- 利用RMAN把ORACLE從WINDOWS轉換到LINUXOracleWindowsLinux