Column Initialisation
Use the Initialisation page of the Column Property Editor to determine how each field is to be initialised when a new record is inserted.
Copy
You have the option of copying the current value from a nominated field:
Increment
Or increment the new value by a specified increment (for numeric fields). If there is no existing value to increment, you can select an option to leave the value blank rather than populate the field with a formatted default value:
Click on 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 |
Replace blank values
Blank values can be replaced with either:
- A fixed constant value
- The current date and time
- The current user's logon name
-
A value returned from a query
Note: Use a fixed value (constant) when initialising a date column. The format dd/MM/yyyy must be used for the fixed date.
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.
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.