DELETE command

Deletes an Analytics project item, a field from a table layout, a variable, one or more table history entries, a relation between tables, or a file in a Windows folder. Also removes a column from a view.

Syntax

Purpose

Syntax

To delete an Analytics project item

DELETE item_type item_name <OK>

To delete a field from a table layout

DELETE field_name <OK>

To remove a column from a view

DELETE COLUMN view_name field_name <ALL> <OK>

To delete a variable or all variables

DELETE {variable_name|ALL} <OK>

To delete the history for the current Analytics table

DELETE HISTORY <retain_history_entries> <OK>

To delete a relation between two tables

DELETE RELATION <child_table_name|relation_name> <OK>

To delete a file

DELETE file_name <OK>

To delete all record notes, and the auto-generated RecordNote field, from the open table

DELETE NOTES <OK>

Parameters

Name Description
item_type item_name

The type and name of the item to delete.

Specify one of the following item types:

  • FOLDER the specified project folder and all its contents
  • FORMAT the specified table layout, all its views, and its associated indexes and relations

    Any other table layouts for the associated table are retained.

    The data file (.fil) associated with the table layout is not deleted unless the Delete Data File with Table option is selected in the Table tab in the Options dialog box (Tools > Options).

    You can also use the SET DELETE_FILE {ON|OFF} command in a script or on the command line to turn this option on or off. For more information, see SET command.

    Caution

    Use caution when turning on the Delete Data File with Table option. It may be an original data file that is deleted along with the table layout.

    Data files are deleted outright. They are not sent to the Windows Recycle Bin.

  • REPORT the specified view

    You cannot delete a view if it is currently active.

  • COLUMN the specified column
  • SCRIPT (or BATCH) the specified script
  • WORKSPACE the specified workspace
  • INDEX the specified index
  • NOTES all record notes from the open table, and the RecordNote field from the table layout
field_name ALL

Delete a field

The name of the field to delete from the current Analytics table layout.

You can delete a field from a table layout even if the field is included in the current view.

Note

You cannot delete a field referenced by a computed field unless you first delete the computed field.

Remove a column

The name of the column to remove from the specified view.

Note

Use the physical field name, not the column display name.

  • ALL included removes all occurrences of the column in the view
  • ALL omitted removes the first (leftmost) occurrence of the column in the view
view_name The name of the view to remove a column from.
variable_name | ALL

The name of the variable to delete. Use ALL to delete all variables.

If you specify ALL, all occurrences of the following types of the variables are deleted from the project:

  • system variables
  • temporary user-defined variables
  • permanent user-defined variables

Note

You cannot delete a variable referenced by a computed field unless you first delete the computed field.

HISTORY retain_history_entries

Deletes all table history entries except for the number of most recent entries specified by retain_history_entries.

Omit retain_history_entries to delete all entries.

RELATION child_table_name | relation_name

Deletes any relation that has no dependent relations and no related fields referenced in either the active view or in an active computed field.

Use the options to specify which relation to delete:

  • child_table_name use when the relation was not specifically named (default name when a relation is created)
  • relation_name use when the relation was specifically named when it was created. Otherwise, use child_table_name

If you do not use either option, the last relation that was defined gets deleted.

file_name

The name of a physical file to delete.

You can specify an absolute or relative path to a file you want to delete. If the path has spaces, enclose it in double quotation marks.

OK

optional

Deletes items without presenting a confirmation dialog box.

Examples

Deleting a date field

You delete the Date field from the table layout associated with the Ar table:

OPEN Ar
DELETE Date

Deleting multiple columns from a view

You delete two columns from the AR_Report view associated with the Ar table. You specify OK for both DELETE commands so that no confirmation prompt is displayed when the script runs:

OPEN Ar
DELETE COLUMN AR_Report Date OK
DELETE COLUMN AR_Report Invoice_Date OK