Hi
Want to delete all rows from my SQL table. Created the following FeatureWriter to set to delete:However, ran it in my workbench and the database records are still not deleted. Anything that I did wrong? Thanks.
Hi
Want to delete all rows from my SQL table. Created the following FeatureWriter to set to delete:However, ran it in my workbench and the database records are still not deleted. Anything that I did wrong? Thanks.
What is the input? A single feature to initiate the proces? Then you can change the Row Selection to Where Clause and enter 1=1. As this is always true it will delete all records.
Edit: I see you have put the Table Handling to Truncate Existing. From the documentation:
Truncate Existing: If destination table/list does not exist, the translation will fail. Otherwise, delete all rows from existing table or list.
So this feels not correct. What do you want to achieve? Do you want to write records to a table, and clean the table before writing? Then you just can use Insert and Truncate Existing.
Hi nielsgerrits,
Actually what I wanted to achieve is to delete all records in a SQL database table (far left) and then import from another source into the same table again:
Basically we just want to refresh the SQL table with new records. Hope this helps.
Hi nielsgerrits,
Actually what I wanted to achieve is to delete all records in a SQL database table (far left) and then import from another source into the same table again:
Basically we just want to refresh the SQL table with new records. Hope this helps.
I think this technically should work, you only need one feature to initiate the FeatureWriter. You can do this by connecting a Creator transformer before the FeatureWriter. It does not matter what it does output, as it's only to start the FeatureWriter.
A more usual way to do this is to use the database function "Truncate" in the writer on the right side. It then removes all records from the table prior to inserting the new ones.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.