Application icon

Remove Items from Query Database

This function will remove one or more items from an open query database.

Click here for information on identifying an open database.

The key is used to identify the item to be removed. If the key field starts with #, it must be followed by an integer in the range of 0 through Query Database Row Count-1 which is a named variable initialized when the database was opened. This form species an absolute row number to be removed. Note if the database was opened Keyless, this is the only way an item will be removed.

The general key field formats are described in Query Database Keys. These formats are extended for this statement. The following formats are supported in the key field:

key name

A symbolic key is being used to specify the item to be removed. This will not work with a query database which was opened as keyless.

#index

index must be an integer in the range of 0 through Query Database Row Count-1 which is a named variable initialized when the database was opened. It is the index of the row to be removed.

#index,count

index is the first row to be deleted. count is the number of rows to be deleted. eg. #3,4 will delete rows 3, 4, 5 and 6. If count specifies too many rows for the database or is less than 0, all rows until the end will be deleted. eg. #10,-1 will delete all rows at or after index 10.

key{\~key}...

This form supplies a list of keys to specify which rows are to be deleted. When the database is opened keyless, all keys must be of the #index form. When the database is opened with a specified key type other than keyless, all keys must be symbolic.

Text fields may contain any of the escape sequences described in Escape Sequences.

The statement is only executed once for all execution modes.

The action test state will be set to true if an item was removed. If the item cannot be located, the action test state will be set to false.

Note that the Query Database-Row Count named variable which was created when the database was opened, will be decremented.