The other element I have just thought about is that when updating database rows. In some forum posts, it has been mentioned to delete rows before adding them again. I am worried that I could have users accessing the database and suddenly when they are looking for data it has disappeared. Is there a better way?
Not at this point. There will be a new action that implements natural SQL updates, but not in the next few months.
OK thank you. I had a thought to create a sub-module that did one or a few rows at a time. What do you think of this idea? Any drawbacks you can think of?
No particular drawbacks come to my mind. I would only recommend saving rows into a temporary .dset file before deleting them from the database. The temporary file can be deleted after updated rows are inserted back successfully. In this case, if something goes wrong your data won’t be lost.
So the sequence would be as follows:
- Import into EasyMorph the rows to be updated
- Save them into a temporary .dset file
- Update the rows in EasyMorph
- Delete the rows in the database table
- Export updated rows into the database table
- Delete the temporary .dset file
If it fails for some reason on steps 4 or 5 then it won’t reach step 6 and the temporary file won’t be deleted. In this case load data from the temporary file back into the database manually.
UPDATE
Updating database rows is now straight forward with the “Update database” action: 💡 Announcement: the "Update database table" action