Skip to main content
Solved

Init query in the JDBC Query Consumer not working for Delete previous data


nuwancml
Fan

  I use Streamsets Data Collector to Load data from Stage 2 database tables (JDBC Query Consumer) using a query and Write loaded data to another Stage 2 Database table (JDBC Producer). I use Init Query as below to delete the previous records before loading data. But this does not delete any record from the table. It would be great if someone can help me.

 

Best answer by Bikram

@nuwancml 

you can use start event with jdbc query option and there you can delete the data from the table before loading data into it.

 

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

2 replies

Bikram
Headliner
Forum|alt.badge.img+1
  • Headliner
  • 486 replies
  • Answer
  • October 18, 2023

@nuwancml 

you can use start event with jdbc query option and there you can delete the data from the table before loading data into it.

 


nuwancml
Fan
  • Author
  • Fan
  • 1 reply
  • October 19, 2023

Thanks for answering. I was using Init Query in the JDBC Query Consumer to delete previous records; it did not work. I removed the init query from the JDBC Query Consumer and added a Start Event. The pipeline works as I expected. The solution you gave works perfectly.


Reply