Databasics

Clearing the Table

We’re often asked, “how do I get rid of blank records in my tables?” The answer is simple… Create a code block in the Trigger After Open section of the Options Screen. In that block, for each table that needs to be cleaned, write a line of code as follows: 

delete(select(‘Table Name’ where ‘Field Name1’ = null and ‘Field NameN’ = null))

In the code line, replace ‘Table Name’ with the name(s) of the table(s) you wish to clean and then replace each ‘Field Name’ with the fields that should never be blank in a valid record. Since this code block is in the Trigger After Open section, it will run automatically when you fire up the database and this will ensure that your tables remain clean and free of blank records.

en_USEN