Delete records
You can use this function to delete rows of data from a specified table using constraints to limit the rows that are deleted.
Some examples are to delete:
- only those rows in a collar table that have a northing greater than a specified value
- all of the assay values below 12 metres in one hole
- all of the samples where gold is less than 1 and silver is less than 5
- all of the drill holes on a certain bench of an open pit
Notes:
-
To delete all data in the database for a particular hole, delete the record of the hole from the collar table (by applying a constraint of hole_id = <holeToDelete>on the constraints form). All the survey, translation and optional table data stored for that hole is then automatically deleted.
- To delete all data in a table, use the CLEAR TABLE function instead.
Prerequisites: A database is open.
To run this function: Choose Database > Edit > Delete records, or Design > Blast design > Edit > Delete records, or Survey > Stations > Delete records
- In the Function Chooser, type DELETE TABLE ROW, and press ENTER.
Fields on the Select the database table to process form
| Field | Description |
|---|---|
| Table name | The name of the table to work with. |
When you click Apply, the Define query constraints form is displayed. You can enter up to 17 constraints.
Fields on the Define query constraints form
| Field | Description |
|---|---|
| Table name | Read-only. The name of the table you opened is displayed at the top of the form. |
| Field name | The name of the field on which you want to impose a constraint. |
| Operand |
The mathematical operation that defines the constraint. The operands are:
|
| Constraint Value |
The value for the constraint. Press TAB to add a second row, or right-click in the left column to add or remove constraint rows. When you have multiple constraint rows, Surpac returns only the records that pass all the constraints. The only exception is that you can you use the hole_id field and the = operator to return multiple rows — in that situation, an OR operator is used between the two constraints. For example, the following constraint would return two records:
Examples: For a surveying example, to select all the survey stations with a specific status, you could add a constraint:
The Constraint value for this constraint is C. To select drillholes or survey stations in a particular area, you could add three constraints:
To select all of the holes where the collar is on a specific bench of an open pit, you could enter two constraints like these:
|
| Load | Loads a constraint from the .dbc file you choose. Be aware that a set of constraints is normally suitable for only the table on which it was created, or on tables that have the same or a very similar structure. |
| Save | Saves the constraint to a .dbc file so you can reload it later. |
Output
The rows are deleted. The Message window reports how many rows have been deleted from each table.