Column Initialisation

Use the Initialisation tab of the Column Property Editor to determine how each field is to be initialised when a new record is inserted.

Copy the current value

Select this option to copy the current value from the nominated Dataset and Column:

Increment the new value

Select this option to increment the new value by a specified Increment value (for numeric fields).

You can enter a Format for the increment value in the field provided, or click the Build button to build a Format Mask.

The syntax of a format mask depends on the data type of the source field. The letter used after the percentage sign can be either "s" for String (alphanumeric) or "f" for Float (numeric).

The following are examples of typical format masks:

Mask Description
%s String value, variable length
%8s String value, fixed length (8 characters)
%-10s String value, fixed length, left justified
%f.2 Numeric, variable length, two decimals
%f8.2 Numeric, fixed length, two decimals
%f8.0 Numeric, fixed length, no decimals

Select the Blank if no value to increment option to leave a field with no existing value to increment blank rather than populate it with a formatted default value:

Replace a blank value

Blank values can be replaced with either:

  • A fixed constant value
  • Note: Use a fixed value (constant) when initialising a date column. The format dd/MM/yyyy must be used for the fixed date.

  • The current date and time
  • The current user's logon name
  • A value returned from a query

For example:

SELECT HOLE_LENGTH

FROM DBO.COLLAR_DETAILS

WHERE PROJECT = :PROJECT AND HOLE_NAME = :HOLE_NAME

The Initialisation page can be used to deal with identifier columns and unique identifier columns.

Note: The use of identity columns or unique identifier (GUID) columns in Micromine Geobank can be problematic. This is true for any column that is generated by the database, e.g. as the result of a trigger. For information on resolving such issues, see Unique Identifier Columns in SQL Server.

Manually executing initialisation while editing a data view

The initialisation code that is programmed into the column properties of the data view is executed automatically when a new record is inserted.

However, in some situations it may be beneficial to execute this code manually while the record is being edited. This can be done by choosing Edit | Initialise Record from the data view menu. It is also possible to initialise several consecutive records by choosing the Edit | Initialise Many menu option.

Column Editor Controls