add-attributes ("nat")

See this command in the command table.

To access this command:

  • Data ribbon >> Attributes >> Add

  • Use the Command Line

Command Overview

Adds a new attribute (column) to an object in memory.

In 2018, Datamine introduced support for 24-character attribute field names in extended precision (EP)files, providing the system is running in Long Field mode. Single precision files remain bound by the 8-character field name limit, as do all systems running in Short Field mode.

Unless otherwise specified, you can use up to 24 characters in attribute names in EP files, but be aware that these fields will automatically be truncated when:

- The same data file is read into a legacy system prior to 2018

- The file is converted to a single precision file in Table Editor

- The file is converted to a single precision file on saving or export.

- The file is converted to a single precision file through DmFile script access.

More on Attribute Naming Conventions...

About Attributes

Attributes can be an alphanumeric or numeric, and are restricted to 24 characters in most cases (restrictions exist for specific processes - detailed in individual help files).

If you attempt to add an attribute name that already exists in the selected object, a warning will be displayed and it will not be added. Similarly, restricted Datamine attribute names cannot be used.

  • Attributes must not start with the following characters: "*", "&", "@", "!", "?", ".".

  • Attributes must not contain spaces, or the following characters: ",", "!", " :", "*", "&", "=", "()".

Default Attribute Values

When adding attributes, you must specify a default value. This will be used in the absence of other data values. You can choose any default value you like, providing it is of an appropriate type.

  • Alphanumeric attributes: the 'default default' is a hyphen, a special character indicating absent data. You can choose any other value, numeric or otherwise to be the default value.

  • Numeric attributes: default values can be any numeric value, but can also be a hyphen, representing absent numeric data. Note that this is not the same as zero.

To Add an Attribute Using a Script:

Scripting information: The AddColumn method on the ObjectData.Schema class can be accessed via the IDmOverlay interface.



The format for scripting this command is:



IDmOverlay->ObjectData.Schema.AddColumn

Command Steps:

  1. Running the command opens the Add Column screen.

Note: This screen can also be accessed from the context menu of the Loaded Data control bar: right-click a loaded data object, and select Add Column.

  1. Select the object in memory which the attribute will be added to from the Object:drop-down list - if you launched this dialog from the Loaded Data control bar, only the selected object is listed.

  2. Complete the following fields as required:

    • Name

    • Type

    • Default Value (see "Default Values")

    • Length (alphanumeric attributes only)

      • Column lengths must be specified as a multiple of 4

   openbook.gif (910 bytes)    Related Topics

 

Attribute Naming Convention