0
我正在從mysql數據庫插入一個文本字段到oracle clob列。oracle sql開發人員不存儲unicode
當我做到這一點看來,Oracle表不支持Unicode作爲「和」字符顯示爲???。
我必須使用CLOB的文本字段遠遠大於VARCHAR2可以提前舉行
感謝提供關於此事的任何幫助
Perl腳本從MySQL數據庫的數據移動到Oracle數據庫:。
sub do_crc_company_overview {
my ($sth_mysql, $sth_oracle);
my $sql_details = <<END_SQL;
select
tblRecommendations.code,
tblRecommendations.description,
tblRecommendations.overview,
tblRecommendations.performance,
tblRecommendations.updated
from
crc.tblRecommendations
where
tblRecommendations.code not in (
select
tblRecommendations.code
from
crc.tblRecommendations
where
tblRecommendations.code regexp "[0-9]"
)
END_SQL
# variables to bind values to
my ($code, $description, $overview, $performance, $updated);
eval {
# first clean out the oracle table
$sth_oracle = $dbh_oracle->prepare(q{delete from tblRecommendations});
$sth_oracle->execute;
# create oracle insertion query
$sth_oracle = $dbh_oracle->prepare(q{
insert into
tblRecommendations (
code,
description,
overview,
performance,
updated
)
values
(?, ?, ?, ?, ?)
});
# prepare our select statement for mysql
$sth_mysql = $dbh_mysql->prepare($sql_details);
$sth_mysql->execute;
$sth_mysql->bind_columns(\($code, $description, $overview, $performance, $updated));
while ($sth_mysql->fetch) {
# feed the data into the tblRecommendations table
# in the database, which has been cleaned out
$sth_oracle->execute($code, $description, $overview, $performance, $updated);
}
};
從Oracle數據庫把數據:
class CrcCompanyInfo < Sequel::Model(IM.database[:tblRecommendations])
#Only selects companies that have one or more active instruments
set_dataset select(
:tblRecommendations__code => :code,
:tblRecommendations__description => :crc_description,
:tblRecommendations__overview => :crc_overview,
:tblRecommendations__performance => :crc_performance,
)
這工作,因爲我能夠從數據庫中的其他表中提取數據。
我已經縮小到下列字符不正確。
“ = left quote = 「
†= right quote = 」
‘ = left single quote = ‘
’ = right single quote = ’
â€」 = en dash = –
â€「 = em dash = —
• = hyphen = -
… = ellipsis = …
我曾嘗試在Oracle表做的更新來改變這些,但Oracle表不成立的滑稽鍵,它只是改變了他們全部「???」因此更新沒有奏效。有人可以給我任何有關如何在數據被輸入到oracle數據庫之前或之後更新數據的問題嗎?
謝謝
你有什麼試過,你是否試圖調查爲什麼會發生這種情況?閱讀本文:http://www.joelonsoftware.com/articles/Unicode.html – jsedano
我曾嘗試將oracle sql developer的編碼設置更改爲utf8,然後重新加載數據。這沒有效果。對不起,即時通訊新的所有這一切,所以不知道該怎麼嘗試。 – JordanC
如何將文本保存到CLOB中,以及如何恢復它們,提供示例代碼,以便人們更容易地幫助您 – jsedano