This topic provides guidelines for selecting a data field
type when you add a field.
When you add a field, you must select its data type
(see Adding fields to a record type. The data type
you select determines the type of values that the user can enter in
the field.
Keep these factors in mind when selecting field types:
- Think through your selections and test them, because it might
be difficult to make changes later.
For example, you cannot modify
the field Type or DB Column Name after you check in the schema; you
cannot modify the Maximum Length property of fields whose type is
SHORT_STRING. To make these changes, you must delete the field and
create a new field with similar properties.
- For fields whose data type is SHORT_STRING, enter a value for
Maximum Length that is greater than the longest string that you expect
to have. The effect of a larger value is to reserve more space on
the disk drive, which reduces need to truncate entries.
- A single-string field (MULTILINE_STRING and SHORT_STRING) is suitable
for general information, such as descriptions, comments, and known
workarounds. If you expect to use information in the field for sorting
or filtering in a query, use several smaller fields. For example,
instead of one computing environment field, you might want separate
fields for hardware vendor, operating system, and operating-system
version.
- Use several smaller fields if you want to enforce content rules,
for example, requiring telephone numbers to be all digits.
- The SHORT_STRING type is appropriate for fields that contain one
selection from a list of choices (choice list).
The choice list
can either be incorporated into the schema (as a constant list) or
maintained through the client interface (as a dynamic list). The latter
method does not require that you change the schema and upgrade the
user database just to add or remove any items on the list. You can
prevent others from adding entries that are not valid by selecting
the Limit to list check box on the choice list
property sheet.
- If you want to provide a set of choices, but let users select
more than one item, you can either provide different fields (and corresponding
check box controls), or you can use a MULTILINE_STRING field and a
list box control.
- When testing changes made using a test database, after values
are entered in a field, changing the data type of that field after
you click introduces the risk of data corruption
if any values of the old data type are stored in that field. To alter
the field data type after running , delete the field and
create a field with the desired properties and a different data type.
These data types are supported:
- Data
- Description/comments
- ATTACHMENT_LIST
- Allows records to store files related to the record.
- DATE_TIME
- SQL date and time. For more information, see Dates and times.
- INT
- SQL integer.
- MULTILINE_STRING
- A variable-length string of unlimited size.
- REFERENCE
- A reference to a unique key in a record type. For REFERENCE type
fields, you must select a state-based or stateless record type to
refer to. You can also enter an optional back-reference field to create
a link from the referenced record to this field record and can specify
that the referenced record type is under security control.
- REFERENCE_LIST
- Multiple references to unique keys in record types. Reference-list
fields allow you to reference multiple records within a field. You
can use reference-list fields with a parent/child control to link
related records. For REFERENCE_LIST type fields, you must select
a state-based or stateless record type to refer to. You can also enter
an optional back-reference field to create a link from the referenced
record to this field record.
- SHORT_STRING
- A variable-length character string with a 254-character maximum.
You set the length in the Properties window when defining the field.
Enter a value between 1 and 254 in the Maximum Length field. When
a user enters a value in a field of the type SHORT_STRING, any leading
or trailing spaces are removed.
- DBID
- Reserved for system fields.
- ID
- Reserved for system fields.
- JOURNAL
- Reserved for system fields.
- STATE
- Reserved for system fields.