Execute a Shell Script to Validate Data
This example executes a shell script that runs another script that validates data after Replicat applies the last transaction in a test run. On the source, an event record is written to an event table named source.event
. The record inserts the value COMPARE
into the event_type
column of the event table, and this record gets replicated at the end of the other test data. In the TABLE
statement in the Replicat parameter file, the FILTER
clause qualifies the record and then triggers the shell script compare_db.sh
to run as specified by SHELL
in the EVENTACTIONS
clause. After that, Replicat stops immediately as specified by FORCESTOP
.
Extract:
TABLE src.*; TABLE test.event;
Replicat:
MAP src.*, TARGET targ.*; MAP test.event, TARGET test.event, FILTER (@streq (event_type, 'COMPARE')=1), & EVENTACTIONS (SHELL 'compare_db.sh', FORCESTOP);