How to control data syncying data using sync recipe when source table has no records.
nehathakkar
Registered Posts: 1 ✭✭✭✭
Hi,
The DB connection that I use has truncate table option enabled when the schema of target table does not change. And I cannot alter the connection setting as it is used by multiple users.
My requirement is to sync some data from table A to table B. I want to only sync the tables when there is some data in table A and not sync when there are no records in table A . Because if I sync when there are no records in table A, all data in table B gets truncated and no data is present in table B at the end of the job. Please let me know how can I achieve this.
Thanks,
Neha
The DB connection that I use has truncate table option enabled when the schema of target table does not change. And I cannot alter the connection setting as it is used by multiple users.
My requirement is to sync some data from table A to table B. I want to only sync the tables when there is some data in table A and not sync when there are no records in table A . Because if I sync when there are no records in table A, all data in table B gets truncated and no data is present in table B at the end of the job. Please let me know how can I achieve this.
Thanks,
Neha
Tagged:
Answers
-
Hi,
This can be achieved using a DSS scenario: with a custom Python step, you could query the dataset A to see if there are records, and only trigger the build of B if there were records in A.