Question:
How can I delete all the records from a database via E3?
Solution:
To do so, you have to create a Query and, in it, set up the SQL commands to delete all records from the database. These commands will vary according to the database being used.
SQL command for Access:
DELETE *
FROM TableName
SQL command for SQL Server:
DELETE
FROM TableName
SQL command for Oracle:
DELETE
FROM TableName
Then, with an application script, just execute this command to run the query.
Example: script being executed in a button’s Click event and running Query2 (set up to delete data from the database):
Screen.Item(“Query2”).Execute(ImmediateExecute)