Navigation:  NexusDB Guide > Management Tools > The Enterprise Manager > Creating and Restructuring Tables > Table Structure Window >

Field Descriptors

Previous pageReturn to chapter overviewNext page

NexusDB V3 Manual

Field Descriptors

button_main button_prev button_next

NexusDB Manual V3 > Management Tools > The Enterprise Manager > Creating and Restructuring Tables > Table Structure Window

 

 

clip0166

 

Name

 

A field Name is required. Please note that the field name has to comply with the SQL:2003 regular identifier restrictions.

 

Type

 

A field Type is required. Take a look at the Field Types section for a list of NexusDB types and their capacity.

 

Units

 

For most types this is implicit and can't be set, but some types (strings, byte array) also require a value for size which is entered in the Units column. Again please take a look at the Field Types section if you're not sure about the capacity of a certain type.

 

Decimals

 

The Decimals column can be used for floating point fields.  It is not, however, mandatory for these fields. For string fields, if decimals is set equal to the units value, it implies that the strings are padded with blanks.

 

Required

 

Check the Required tick box if the field must have a non-null value.

 

Map From Field

 

Map from Field is only visible when you restructure tables. It displays the field map (on a field by field basis as shown) used when the table is restructured.

 

Data Loss Action

 

Like Map From Field this column is only visible if you're restructuring a table. While trying to restructure a table, it might be possible that some field values can't be mapped without a loss of data. By setting this option you can tell NexusDB what to do if this happens. The possible actions are dlaFail (the restructure is stopped and the original state is restored), dlaNULL (set the field where the data loss occurred to NULL) and dlaBestFit (copy the best fitting value that NexusDB can determine e.g. truncate a string field to fit a new column length).

 

 

Default Values

 

In NexusDB V2 we've introduced a much more flexible way of defining/setting a default value for a field. Actually we've gone even a bit a further and allow to also apply Default values when a record is updated. This can be very handy for example to enforce a certain value if the column is set to NULL by a user.

 

Each field has one of these:

 

Default Descriptor

 

NexusDB offers different types of default descriptors. The currently available ones are

 

TnxAutoGuidDefaultValueDescriptor,

TnxCurrentDateTimeDefaultValueDescriptor,

TnxEmptyDefaultValueDescriptor and

TnxConstDefaultValueDescriptor.

 

The first two are special generators: TnxAutoGuidDefaultValueDescriptor creates a new unique GUID every time it is applied. TnxCurrentDateTimeDefaultValueDescriptor sets the field to the current date and time, while TnxEmptyDefaultValueDescriptor always sets the field to NULL.

 

TnxConstDefaultValueDescriptor allows the user to specify a certain value as Default Value that will be applied.

 

Default Value

 

You can only specify a value in the Default Value row for the TnxConstDefaultValueDescriptor (or better, the others ignore a value). Please make sure that the value complies with the data type chosen for the field and does not violate constraints set elsewhere (e.g. Referential Integrity).

 

Apply At

 

Due to the nature of NexusDB being a real Client/Server system, you've the option to apply the default setting on the Server, Client or on Both. For best consistency it is advisable to have always Both selected here.

 

ApplyOnInsert

 

Checking this option makes sure that NexusDB applies the default for every newly inserted record.

 

ApplyOnUpdate & OverwriteNonNULL

 

You can force NexusDB to apply the default value when a record is updated too. This can e.g. be handy to enforce a certain value in a column, instead of NULL. Set OverWriteNonNULL if you want to always apply the default value.

 

 

 

Locale Descriptor

 

Each field can also have a locale descriptor attached. If a field does, then for this field it overrides the setting in the global locale descriptor. For specific information on the locale descriptor options please see the windows SDK help on CompareString.

© Nexus Database Systems Pty Ltd.

nexus_logo