How to update all the records in a table with SQL?

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
gvc
User
Posts: 3

How to update all the records in a table with SQL?

Post by gvc »

What event do I use to update all the records in a table with this SQL? What is the correct syntax?

UPDATE ListDecades SET Finish = CASE WHEN YEAR(CURDATE()) - DecadeInteger < 0 THEN 0 ELSE YEAR(CURDATE()) - DecadeInteger END, Start = CASE WHEN YEAR(CURDATE()) - DecadeInteger - 10 < 0 THEN 0 ELSE YEAR(CURDATE()) - DecadeInteger - 10 END


mobhar
User
Posts: 11905

Post by mobhar »

You may use ExecuteStatement global function to execute your SQL Update above. If you want to update after editing an existing record, then you may put that code in Row_Updated server event.


gvc
User
Posts: 3

Post by gvc »

Perfect! Thank you!

Gary


Post Reply