Skip to main content
Announcements
UPGRADE ADVISORY for Qlik Replicate 2024.5: Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
kritostar
Contributor III
Contributor III

Truncate source

Is it possible to truncate the source but leave the destination with everything replicated? I saw there is an option 

When source table is truncated: Ignore TRUNCATE

but can I set the replication to delete what it has already copied?

Labels (1)
2 Solutions

Accepted Solutions
Heinvandenheuvel
Specialist III
Specialist III

I find it hard to understand what you want to achieve here. Please help us help you. Reread your questions, ask a colleague if they understand the way it is written.

 Specifically:

"can I set the replication to delete what it has already copied?"

On the source? NO, Replicate only makes changes on te target. On the target? Wouldn't that be allowing the truncate.

"can I set the replication to delete what it has already copied?"

On the source/? NO, Replicate only makes changes on te target.

"Can I then add a flag on the source and the replication turn the flag on so next time only the ones with an off flag get replicated?"

Now you make me wonder whether you are designing a CDC task or a full-load task. Because a CDCD task would only act on newly added or changed row. For a fulllaod task you could add a flag field on the source and a filter in the task design to only  load for specific flag values. You would have to manually set that flag, perhaps rigth after a fullload was run. Maybe a timestamp is more versatile than a flag in such scenario? Any please use a few more word, or a list of steps you intend to have take place to clarify the problem instead of questioning directly for a solution detail.

hth,

Hein.

 

View solution in original post

Steve_Nguyen
Support
Support

@kritostar 

Replicate does not have this feature "deleting the source cause we don't need it anymore. "

 

you can submit Feature request below :

https://community.qlik.com/t5/Ideation/ct-p/qlik-product-insight

Help users find answers! Don't forget to mark a solution that worked for you! If already marked, give it a thumbs up!

View solution in original post

10 Replies
narendersarva
Support
Support

Hi @kritostar 

You cannot truncate source table using Ignore TRUNCATE.

The Ignore TRUNCATE option you mentioned is used to prevent the replication of the TRUNCATE statement to the destination. This is useful when you want to preserve the data in the destination table while still allowing the source table to be truncated. You need to delete the data manually in target, if it's already been replicated.

 

Thanks
Naren

kritostar
Contributor III
Contributor III
Author

Thanks, that's what I thought. Can I then add a flag on the source and the replication turn the flag on so next time only the ones with an off flag get replicated?

Steve_Nguyen
Support
Support

@kritostar 

 

1. what is the source and target.

 

2. normally Replicate does not have option to truncate source or delete source .

 

3. not sure what you are trying to do, more information on your process ?

Help users find answers! Don't forget to mark a solution that worked for you! If already marked, give it a thumbs up!
SwathiPulagam
Support
Support

Hi @kritostar ,

 

Can you provide information about your source and target? Additionally, could you please explain your specific use case? I ask because although the data may be truncated at the source, it appears that you still require that data at the target.

 

Thanks,

Swathi

 

Thanks,

Swathi

narendersarva
Support
Support

Hi @kritostar 

Please refer below user guide for apply change settings to handle the target table for the change processing

Apply Changes Settings #Apply Changes Settings | Qlik Replicate Help

 

Thanks
Naren

Heinvandenheuvel
Specialist III
Specialist III

I find it hard to understand what you want to achieve here. Please help us help you. Reread your questions, ask a colleague if they understand the way it is written.

 Specifically:

"can I set the replication to delete what it has already copied?"

On the source? NO, Replicate only makes changes on te target. On the target? Wouldn't that be allowing the truncate.

"can I set the replication to delete what it has already copied?"

On the source/? NO, Replicate only makes changes on te target.

"Can I then add a flag on the source and the replication turn the flag on so next time only the ones with an off flag get replicated?"

Now you make me wonder whether you are designing a CDC task or a full-load task. Because a CDCD task would only act on newly added or changed row. For a fulllaod task you could add a flag field on the source and a filter in the task design to only  load for specific flag values. You would have to manually set that flag, perhaps rigth after a fullload was run. Maybe a timestamp is more versatile than a flag in such scenario? Any please use a few more word, or a list of steps you intend to have take place to clarify the problem instead of questioning directly for a solution detail.

hth,

Hein.

 

kritostar
Contributor III
Contributor III
Author

Thanks @Heinvandenheuvel , I am going to change the full-load task I was trying to build, to a CDCD task, and keep the source. If we need to clean that table, we can manually truncate the table and turn no option to do nothing upon source truncation. 

Sorry for the confusion, new to qlik replication tasks.

Steve_Nguyen
Support
Support

@kritostar 

 

1. what is the source and target.

 

2. normally Replicate does not have option to truncate source or delete source .

 

3. not sure what you are trying to do, more information on your process ?

Help users find answers! Don't forget to mark a solution that worked for you! If already marked, give it a thumbs up!
kritostar
Contributor III
Contributor III
Author

1. what is the source and target?

The source is a specific table on an Myslq DB and the destination is a table on another DB

2. normally Replicate does not have the option to truncate the source or delete source.

-

3. not sure what you are trying to do, more information on your process?

We are taking all the rows on the source, copying them to the destination and then deleting the source cause we don't need it anymore. Right now we have a PHO cron job that does this, but we are trying to migrate every job we have to replications.