Hello
What you can do is have a shell script that reads in the list of tables from a file and then generates a chcclp script from it. You can then run the chcclp script you have generated:
chcclp=$HOME/map.chcclp
echo "chcclp session set to cdc;" > $CHCCLP
echo "connect server username admin password secret;" >> $CHCCLP
echo "connect datastore name mysource context source"; >> $CHCCLP
echo "connect datastore name mytarget context target"; >> $CHCCLP
echo "select subscription name mysub" >> $CHCCLP
while read line do
# Line is in format sourceSchema,sourceTable,targetSchema, targetTable
sourceSchema=$(echo $line | cut -f1 -d ",")
...
echo "map table sourceSchema $sourceSchema targetSchema $targetSchema sourceTable $sourceTable targetable $targetTable;" >> $CHCCLP
done < $HOME/map_tables
echo "exit;" >> $CHCCLP
------------------------------
Robert Philo
------------------------------
Original Message:
Sent: Thu June 17, 2021 12:55 PM
From: Sivakumar Anbazhagan
Subject: CHCLP script to automate table mappings
Hi Community,
We have a large no of tables to map the subscriptions in CDC and there are several schemas.
Is there a CDC CHCLP batch script to use that can easily do the mapping when I key in the schema name and the name of the subscription I want to use?
Thanks,
Siva
------------------------------
Sivakumar Anbazhagan
------------------------------
#DataIntegration
#DataReplication