Skip to main content
Solved

Overwrite the data using Jdbc Writer


Forum|alt.badge.img+1

Hello,everyone. When you load data into the database using Jdbc Writer and execute the plan every time, it keeps adding the same data from above. How can I overwrite the data? For instance, I have a table like this.


I saved it in the database, made some changes to the table, and when I re-executed the plan, it added the changes on top. Duplicates appeared, to put it bluntly.I will be very grateful for your help Thank you!

Best answer by Albert de Ruiter

Hi @FCB developer , Assel, I haven't implemented such a scenario myself, but I would suggest to look into step SQL Execute (in the Transform section). Via the ?-button you will find more clarification (I have no experience with this step). In the ‘Before script’ field you can likely truncate the table. 

Kind regards, Albert

View original
Did this topic help you find an answer to your question?

4 replies

Albert de Ruiter
Star Blazer L3
Forum|alt.badge.img+4

Hi,

If the target table always needs to reflect the source table, wouldn't it be most straightforward to truncate the target tabe first before loading? 

Or is your requirement more complex?

Kind regards,

Albert 


Forum|alt.badge.img+1
  • Author
  • Data Pioneer
  • 31 replies
  • August 31, 2023

Hi @Albert de Ruiter  
I have a plan, it immediately pours the result into the database. Do you know how to first truncate the target table before uploading to Atacama Desktop?

Kind regards,

Assel


Albert de Ruiter
Star Blazer L3
Forum|alt.badge.img+4

Hi @FCB developer , Assel, I haven't implemented such a scenario myself, but I would suggest to look into step SQL Execute (in the Transform section). Via the ?-button you will find more clarification (I have no experience with this step). In the ‘Before script’ field you can likely truncate the table. 

Kind regards, Albert


Forum|alt.badge.img+1
  • Author
  • Data Pioneer
  • 31 replies
  • September 1, 2023

Hi, @Albert de Ruiter 

Thanks for the idea, I used the SQL Execute step, simplified my task


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings