ソース列とターゲット列のみを含むサンプル例外マッピング
次のサンプル・パラメータ・ファイルは、以降のCDRの例で使用されるソース表およびターゲット表のエラー処理と単純な例外マッピングを示しています。この例でマップするのはソース列とターゲット列であり、追加の列はマップしません。次の理由から、この例の例外MAP
文にはCOLMAP
句は不要です。
-
ソースとターゲットの例外列は、名前と定義がそれぞれ同一です。
-
例外表に他の列がありません。
ノート:
この例では、Replicatパラメータ・ファイルに必要なその他のパラメータ(プロセス名やログイン資格証明、特定のデータベース・タイプに必要なオプションのパラメータなど)を意図的に省略してあります。改行を使用してパラメータ文を複数の行に分割するときは、各行の末尾でアンパサンド(&)を使用します。
-- REPERROR error handling: DEFAULT represents all error types. DISCARD -- writes operations that could not be processed to a discard file. REPERROR (DEFAULT, DISCARD) -- Specifies a discard file. DISCARDFILE /users/ogg/discards/discards.dsc, PURGE -- The regular MAP statement with the CDR parameters MAP fin.src, TARGET fin.tgt, & COMPARECOLS (ON UPDATE ALL, ON DELETE ALL), & RESOLVECONFLICT (UPDATEROWEXISTS, (DEFAULT, USEMAX (last_mod_time)), & RESOLVECONFLICT (INSERTROWEXISTS, (DEFAULT, USEMAX (last_mod_time)), & RESOLVECONFLICT (DELETEROWEXISTS, (DEFAULT, OVERWRITE)), & RESOLVECONFLICT (UPDATEROWMISSING, (DEFAULT, OVERWRITE)), & RESOLVECONFLICT (DELETEROWMISSING, (DEFAULT, DISCARD)), & ); -- Starts the exceptions MAP statement by mapping the source table to the -- exceptions table. MAP fin.src, TARGET fin.exception, & -- directs Replicat only to map operations that caused the error specified -- in REPERROR. EXCEPTIONSONLY, & -- directs Replicat to convert all the exceptions to inserts into the -- exceptions table. This is why there cannot be a primary key constraint -- on the exceptions table. INSERTALLRECORDS ;