Creating an attribute
You create an attribute to store a characteristic of an item.
About this task
An attribute stores units of data (metadata) or values that describe a certain characteristic or property (for example, first name, surname, age, city) of an item. An attribute can be used to locate that item.
To define an attribute:
- Expand Data Modeling in the system administration tree.
- Right-click Attributes and select New to open the New Attribute window.
- In the Name field, type 1 to 32 characters
for the attribute name. This name is the internal name and does not
display in client applications. Restriction: The name attribute can contain only uppercase and lowercase alphabetic characters, numeric characters, and the underscore (_) character. The first character in this field must be an uppercase or lowercase alphabetic character.
- In the Display Name field, enter a name that displays to users in client applications.
- In the Attribute type field, select the
type of information that you want the attribute to contain:
- Click Character to specify that the attribute can contain alphanumeric characters that are stored at a fixed length. This option is the default option and activates the Character type and Character length fields.
- Click Variable Character to specify that
the attribute can contain alphanumeric characters that are stored
at a variable length. The client displays a variable character type
attribute like a character attribute, but stores the attribute data
only at the length that is needed to hold each character in the field.
When you select this option, the Character type and Character
length fields become active. Character length is specified
in bytes.
The actual maximum size and length of a variable character attribute can vary depending on your database operating system. Select a maximum size and length that is not greater than the supported level. For example, Oracle limits you to a size of about 3675. Db2® supports sizes of 28000 and greater.
- Click Short Integer to specify that the attribute can contain whole numbers. The minimum is -32768 and the maximum is 32767. When you select this option, the Integer range field becomes active. Use the Integer range field to further restrict the range of the value that this attribute can contain.
- Click Long Integer to specify that the attribute can contain whole numbers. The minimum is -2147483648 and maximum is 2147483647. When you select this option, the Long Integer range field becomes active to further define the attribute.
- Click Decimal to specify that the attribute
can contain a decimal value. When you select this option, the Decimal
length field becomes active. There are two fields that
are associated with decimal length of a decimal attribute type: Total and Fixed
places. The Total field range is
from 5 to 31 and the Fixed places field range
is from 0 to 5. For example, if you specify 8 in the Total field
and 2 in Fixed places field, then a number
such as 999,999.00 can be stored.Important: Because decimal type data can be converted to floating-point representation in other programs that work with your content management system, there might be data loss if you store extremely large numbers that approach the maximum limit of the Total field.
- Click Double to specify that the attribute can contain a double precision floating point number. The maximum length is six, after which the number is rounded.
- Click Date to specify that the attribute can contain a date. The date is stored in the YYYY-MM-DD format.
- Click Time to specify that the attribute can contain time. The time is stored in the HH.MM.SS format.
- Click Time stamp to specify that the attribute can contain a timestamp for the application. The format of the timestamp is as follows: YYYY-MM-DD-HH.MM.SS.NNNNNN (Year-Month-Day-Hour.Minute.Second.Microseconds).
- Click BLOB to specify that the attribute can contain a binary large object.
- Click CLOB to specify that the attribute can contain a character large object.
Restriction: On Db2, If you specify that the attribute can contain a character large object (CLOB) or a binary large object (BLOB), consider that the total amount of character or binary data that can be passed to the library server for an attribute cannot exceed 320KB. Each character attribute requires 2 additional bytes in the buffer, and the buffer used for binary data also contains control information. When developing an application that uses large attributes, consider implementing these attributes as objects on the resource manager instead. - Selecting Character or Variable
character in the Attribute type group
box enables the Character type group box. Select
the character type.Attention: Enforcement of the character type that you specify is done in client applications; some clients might not enforce it. In addition, each client might permit a different subset of characters for each character type. See the documentation for each client for the character subsets that apply to the following character types.Restriction: The client application might prevent the use of blank spaces in certain attributes.
- Alphabetic
- A - Z, a - z, and alphabetic characters in non-English languages.
- Numeric
- Numerals 0 - 9.
- Alphanumeric
- All alphabetic and numeric characters.
- Extended Alphanumeric
- All alphanumeric characters and all symbols.
- Other
- Any character.
- Click OK to create the attribute.
Restriction:
- Once created, you cannot easily delete an attribute.
- You cannot change an existing attribute from numeric to extended alphanumeric. Once created, the attribute type cannot be changed.