1

私はcシェルスクリプトでこれを行っています。私の結果は0ではなく2に設定されています

sqlldr $ORA_UID/$ORA_PSWD,control=$CTL/${controlfile}.CTL,log=${sqllog},bad=${badlog},DATA=${filename},discard
=${dsclog}

set RESULT = $status

if ($RESULT != 0) then
  echo "Check sql log file"
  exit 1
endif

これが私のログ情報です。警告は表示されません。誰かがこれを手伝ってくれますか。ありがとうございます。

Table "BA"."TABLE1":
  25 Rows successfully loaded.
  0 Rows not loaded due to data errors.
  40785 Rows not loaded because all WHEN clauses were failed.
  0 Rows not loaded because all fields were null.


Table "BA"."TABLE1":
  19147 Rows successfully loaded.
  0 Rows not loaded due to data errors.
  21663 Rows not loaded because all WHEN clauses were failed.
  0 Rows not loaded because all fields were null.


Table "BA"."TABLE1":
  16588 Rows successfully loaded.
  0 Rows not loaded due to data errors.
  24222 Rows not loaded because all WHEN clauses were failed.
  0 Rows not loaded because all fields were null.


Space allocated for bind array:                 252324 bytes(43 rows)
Read   buffer bytes: 1048576

Total logical records skipped:          0
Total logical records read:         40810
Total logical records rejected:         0
Total logical records discarded:     5050
4

1 に答える 1

2

Orafaq Webサイトによると、戻りコード2は警告状態を示します。あなたの場合、これはWHEN句の失敗のためにレコードが破棄されるためです。ウェブサイトから、4つの可能なレベルがあります:

0 - successful 
1 - failed 
2 - warn 
3 - fatal 

あなたはおそらく2を0とともに成功した結果と見なしたいと思うでしょう。

私は長い間CShellを実行していませんが、おそらく次のようなものです。

if ($RESULT != 0 && $RESULT != 2) then
于 2011-07-22T16:48:16.753 に答える