Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How do I clear a table in TOS before transferring data into it?

Hello everyone, 

 

I am using TOS for Data Integration for transferring my data from data source to data warehouse, both on PostgreSQL databases. 

 

Before I transfer my data, I want to empty data warehouse table. How can I achieve this?

 

Thanks!

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

    The designer tab look exactly like a normal insert. Please refer the skeleton diagram below.

0683p000009M3E4.png

 

The only change you need to do is that instead of "Default", you need to select the "Truncate Table" option in the drop down (shown in previous post).

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

12 Replies
Anonymous
Not applicable
Author

Hi,

 

    Please select the drop down Truncate Table under Action on Table label.0683p000009M3Dz.png

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

Anonymous
Not applicable
Author

Thank you for such an early response.

 

Can you please share the connection I need to make in order to implement this?

 

Thanks!

Anonymous
Not applicable
Author

Hi,

 

    Sorry. I didn't get your query. What do you mean by sharing the connection?

 

     You need to use your existing connection to do it but the only change is in Action on Table.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

Anonymous
Not applicable
Author

To implement the "truncate table" action, what does the Designer tab look like or how do I connect this DB to implement this action?

 

Thanks!

Anonymous
Not applicable
Author

This action (truncate) will be performed as the first action when the subjob starts. You do not need any special settings for the truncate action, the connection used to write the data in your table will be used to truncate the table first.

Anonymous
Not applicable
Author

Hi,

 

    The designer tab look exactly like a normal insert. Please refer the skeleton diagram below.

0683p000009M3E4.png

 

The only change you need to do is that instead of "Default", you need to select the "Truncate Table" option in the drop down (shown in previous post).

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

Anonymous
Not applicable
Author

1. In case of multiple tMaps, I do not know which tMap will run first and thus do not know which output table do I truncate. How do I implement this there?

 

2. If I perform this truncate table action and write the data transfer query in the same job, will it work?

 

Thanks!

Anonymous
Not applicable
Author

Hi,

 

    In case of multiple tMaps, you need to give the truncate in first order.

0683p000009M3E9.png

 

But there is a flip side in this approach. If the first dataset is empty, it will not invoke Truncate. So you can gather all the datasets to temp files and then do a tUnite to merge all the different files. Once the file is merged, you can insert them to target DB with Truncate option selected.

 

The answer for your second question is "Yes" 🙂 Please try it once and you will understand yourself.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

Anonymous
Not applicable
Author

Nikhil Thampi - Sorry to say, THAT IS NOT TRUE!

The truncate action will be performed regardless of there a records to write or not! Please take a look at the source code of the job and you will see the truncate action will be performed in the begin-part of the component -> this means BEFORE the actual flow starts.