Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Pre SQL statement Delete based on an input value

klambert
7 - Meteor

I have a mysql table called update_date, the workflow uses this to recalculate everything after that date, when I push the updated results back into the table I want to run a pre SQL delete to remove the existing entries after that date and replace with the newly recalculated ones.

 

The update date changes, so I can't use a workflow constant. Is there a way to do this without having to completely write all the entries back to the table? And only write the updated ones back?

4 REPLIES 4
danilang
19 - Altair
19 - Altair

Hi @klambert 

 

If you put your output tool in a macro, you can pass in the Pre SQL in a field and use an interface tool to update it in the output tool.

 

Dan 

klambert
7 - Meteor

Thank you!

 

I dont suppose you have an example, or link I can go have a look at for more info?

danilang
19 - Altair
19 - Altair

hi @klambert 

 

Look at the second solution in this post.  It uses a macro to update a date in a preSQL statement

 

Dan   

Labels