Type Clause for the Add Attribute Command

The Type clause is always required. It identifies the type of values the attribute will have. An attribute can assume several different types of values. When determining the attribute type, you can narrow the choices by deciding if the value is a number or a character string.

This page discusses:

Once a type is assigned to an attribute, it cannot be changed (exception: changing a string attribute to a binary attribute). The user can associate only values of that type with the attribute.

Type Description
binary Binary attributes must be passed in as a string. The following rules apply to binary types of attributes:
  • Binary attributes are stored in chunks of 4000 bytes of data.
  • You can change any existing string attributes to binary.
  • Dimensions are not supported for binary attributes.
  • Multival attributes cannot be binary.
  • Binary attributes cannot be part of an index or a uniquekey.
  • Interface types are supported on binary attributes.
  • You can define binary attributes as being owned by a type.
  • The transition commands are not supported when used in the context of binary attributes.
  • You cannot define a default value for a binary attribute.
String One or more characters. These characters can be numbers, letters, or any special symbols (such as $ % ^ * &). Although numbers can be part of a character string, you cannot perform arithmetic operations on them. To perform arithmetic operations, you need a numeric type (Integer or Real).

String attributes (as well as description fields) have a limit of 4,194,304 (4*1024*1024). If you expect to handle more data in an attribute, consider re-designing the schema to store the data in a checked-in file instead or use a binary attribute.

Boolean A value of TRUE or FALSE.
Real A number expressed with a decimal point (for example, 5.4321). The range of values it can assume depends on the local system architecture. Both 32-bit and 64-bit floating point numbers are supported. Since real values are stored in the name format of the local system architecture, the precision and range of values varies from architecture to architecture. To obtain the exact range for your system, see your system manual.
Integer A whole number stored as a signed 32-bit integer. Its range is limited by the operating system to be between -2,147,483,648 and 2,147,483,647. If an attribute is set to a number outside this range, its value will be rounded (by the operating system) to the minimum or maximum value.
Date and Time Any collection of numbers or reserved words that can be translated into an expression of time. Times and dates can be expressed using the formats listed below, including the year, month, day, hour, minute, and/or second. Abbreviations or full-words are acceptable for the day of the week and month.

In the following example, the day of the week is optional. Wed Feb 15, 1999

Another way to enter this date is: 2/15/99

In this example, the meridian and time zone information are optional: 01:30:00 PM EST

Another example is: 13:30:00

When you enter both the date and time, the time should follow the date. For example: February 1, 1999 12:52:30 GMT

The actual date/time is calculated based on the current time and date obtained from your system clock. The date range is January 1, 1902 to December 31, 2037. For more information, see Collaboration and Approvals Administration Guide: About Date Properties. For any attribute with a date format, even if you have a date setting in your initialization file (enovia.ini) and you input any date without a year, the date is accepted and converted to Sat Jan 01, 0000, 12:00:00 AM. Dates should be input as the full date, including the year.

enumA range of string values. Enum attributes cannot be multi-valued. You also need to define the specific range values. The individual range values have a maximum length of 255.

Do not use the range clause for attributes that use the enum type.

shortbinaryAn internal id value, such as a physicalid. Shortbinary attributes can be multi-valued. Multiline and range values are not allowed.

When adding an attribute using the enum type, you need to specify the range values:

add attribute ATTRNAME type enum default VALUE1 range equal VALUE1 
range equal VALUE2 +;

You do not need to specify a default. If you do not define a default, the ranges are sorted alphabetically and show the first alphabetic value unless another value has been set.

For example:

add attribute Colors type enum default Red range equal Red range equal Blue
range equal Yellow range equal Green;

You can define an attribute to not have any default value by using !hasdefault. For example, using the following command, you can define that an attribute is of type integer and it does not have a default value.

add attribute attributeName integer !hasdefault;

About Floating Point Precision/Output

For a floating point number F, the number of digits of accuracy maintained, and the number of digits printed depends on the magnitude of the absolute value of F.

Absolute Value Accuracy Output Possibilities
< 1.0 13 digits exact "0." + leading zeros
14th digit rounded + maximum of 14 nonzero digits
>= 1.0 14 digits exact no leading zeros
15th digit rounded + maximum of 15 nonzero digits + 0's up to 15th digit + non-significant digits +".0"

In the case where ABS(F) < 1.0, there are never any digits printed beyond the maximum of 14.

For large numbers, it might be necessary to pad if the number of digits before the decimal point exceeds 15. These non-significant digits are subject to precision inaccuracies of the operating system, and can include random nonzero digits, as is demonstrated in the examples below by A digitsBig3 0.

Examples

add bus A digitsBig1 0 policy A vault Standards; 
add bus A digitsBig2 0 policy A vault Standards;
add bus A digitsBig3 0 policy A vault Standards;
add bus A digitsBig4 0 policy A vault Standards;
add bus A digitsSmall1 0 policy A vault Standards;
add bus A digitsSmall2 0 policy A vault Standards;
add bus A digitsSmall3 0 policy A vault Standards;
add bus A digitsSmall4 0 policy A vault Standards;
mod bus A digitsBig1 0 r1 1.234567890123459999;
mod bus A digitsBig2 0 r1 123456789.0123459999;
mod bus A digitsBig3 0 r1 1234567890123459999.0;
mod bus A digitsBig4 0 r1 1234567890123459999000000000.0;
temp query bus A digitsBig* * select attribute[r1] dump ' ';
A digitsBig1 0 1.23456789012346
A digitsBig2 0 123456789.012346
A digitsBig3 0 1234567890123460100.0
A digitsBig4 0 1234567890123460000000000000.0
mod bus A digitsSmall1 0 r1 0.1234567890123459999;
mod bus A digitsSmall2 0 r1 0.0001234567890123459999;
mod bus A digitsSmall3 0 r1 0.00000000000001234567890123459999;
mod bus A digitsSmall4 0 r1 0.000000000000000000000001234567890123459999;
temp query bus A digitsSmall* * select attribute[r1] dump ' ';
A digitsSmall1 0 0.12345678901235 
A digitsSmall2 0 0.00012345678901235 
A digitsSmall3 0 0.000000000000012345678901235 
A digitsSmall4 0 0.0000000000000000000000012345678901235