Add a new cleanup method of "append" for CopyOver procedures
Answered-
Comment actionsOfficial comment
Hi Gary,
thanks for your request. I believe the functionality you are looking for is already present as SYSADMIN.batchUpdate. batchUpdate will newly create the target table on the first run if it doesn't exist yet and append data on any subsequent run. It optionally also has a parameter to specify a primary for preventing duplicates. If that parameter is omitted, batchUpdate will do a plain INSERT.
There are some additional details and examples in our documentation. Please let me know if that helps.
Best regards
Niklas
-
Hi Salem,
we do have the possibility already to create copyOver jobs with truncate as the cleanup method (in the Studio via the "Create replication job" window), but you are right that the SYSADMIN.copyOver procedure doesn't support truncation yet on a programmatic level outside of a job.
You can emulate the behavior with a workaround like this currently:
BEGIN ATOMIC
CALL target_datasource.native('TRUNCATE target_table');
INSERT INTO target_datasource.target_table SELECT * FROM source_schema.source_view;
ENDBut I agree it would be handy to have SYSADMIN.copyOver supporting this natively. I have added your request to our wishlist. I can't make any promises at this point regarding a timeline, unfortunately, but I will keep you posted here when there is any news.
Best
Niklas
Please sign in to leave a comment.
Comments
3 comments