在Windows上使用sqlplus 11g在11g數據庫上運行sql腳本。如果插入行留在腳本中,Sqlplus掛起。如果我註釋掉插入行,腳本將返回記錄。SQLPlus命令行腳本在插入記錄時掛起
腳本執行時間是<在sql開發中運行1秒。
我試圖使插入聲明一個連續的行與相同的resutls。
使用echo時,它在sql最後一行(...爲空;)後立即掛起並顯示一條新行開始,提交從不處理。我想我的INSERT語句是不正確syntaxed到在sqlplus運行
命令行調用:
sqlplus e_fraud/[email protected] @"C:\temp\Actimize_ETL\Versions\03\sql\merge2000_insert_new_bank_keys.sql"
SQL腳本:
--insert into e_fraud.bank
select stg.bank_key bank_key, stg.bank_key bank_name from
(
select distinct account_bank bank_key
from e_fraud.rgbk_stg_account
where account_bank is not null
or account_bank != ''
UNION
select distinct bank_key
from e_fraud.rgbk_stg_branch
where bank_key is not null
or bank_key != ''
) stg
left outer join e_fraud.bank b
on stg.bank_key = b.bank_key
where b.bank_key is null;
commit;
exit;
打開sql開發者,我測試了插入語句,執行了一個提交;現在sqlplus正確執行腳本。完美的答案。 – longday 2010-08-28 16:08:30
哦,你剛纔救了我這麼多時間......完全相同的情況(sqlplus + sql developer)。 – rogerdpack 2011-09-20 18:37:18