Difference between setTmp() and delete

Hi All,

What is the difference using setTmp() on a table to make it a temporary one and using delete_from and deleting the records in the table?



setTmp will make the current buffer to act as a temporary table, so what ever the data manipulation done on that buffer will not effect the data in the DB. delete_from is a set based delete operation which will delete the data from the database.

The difference is that setTmp() has nothing to do with deletion at all. It turns a buffer to a temporary one, therefore it saves records to memory/on disk instead of into database. If you delete everything from the temporary buffer, it doesn’t delete anything in database, obviously.