Archibus AFM Type vs. Database Data Types

Archibus schema supports the following data types. These have different physical data types under Microsoft SQL Server and Oracle. ODBC also supplies type information in a different format. Internal to Archibus, the program stores these data items in memory objects of yet another type.

The type mappings are:

AFM Type Oracle SQL Server Size Matters Decimals Matters
SQL_CHAR "VARCHAR2(%d)" "CHAR(%d)" TRUE FALSE

SQL_NUMERIC

"NUMBER(%d,%d)"

"NUMERIC(%d,%d)"

TRUE

TRUE

SQL_DECIMAL

"NUMBER(%d,%d)"

"NUMERIC(%d,%d)"

TRUE

TRUE

SQL_INTEGER

"NUMBER(*,0)"

"INTEGER"

FALSE

FALSE

SQL_SMALLINT

"NUMBER(*,0)"

"SMALLINT"

FALSE

FALSE

SQL_FLOAT

"FLOAT"

"FLOAT(53)"

FALSE

FALSE

SQL_REAL

"REAL"

"REAL"

FALSE

FALSE

SQL_DOUBLE

"NUMBER(%d,%d)"

"FLOAT(53)"

FALSE

FALSE

SQL_DATE

"DATE"

"DATETIME"

FALSE

FALSE

SQL_TIME

"DATE"

"DATETIME"

FALSE

FALSE

SQL_TIMESTAMP

"DATE"

"DATETIME"

FALSE

FALSE

SQL_VARCHAR

"VARCHAR2(%d)"

"VARCHAR(%d)"

TRUE

FALSE

SQL_LONGVARCHAR(-1)

"VARCHAR2(%d)"

"VARCHAR(%d)"

TRUE

FALSE

Note the following about these data types:

Oracle LONG Fields

The Archibus default schema uses only VARCHAR2 fields and avoids the Oracle LONG fields. This mapping works around several limitations of the LONG data type under Oracle.

Specifying Field Widths

For international versions, Archibus uses Unicode UTF-8 encoding so that the database can record strings from multiple languages in the same database.

For historical reasons, Archibus field widths (A/FM Fields, Size values) are in BYTEs rather than the number of Unicode CHARs. (The Oracle setting for this is the NLS_LENGTH_SEMANTICS with which the field was created.) Current databases keep this length, as the difference affects few sites.

Sites who want to use the Unicode CHAR field width measurement can change this setting by using the Schema Change Wizard. The Smart Client, the Web Central Java routines, and the Web Central JavaScript forms all work with this setting. Using the Unicode CHAR field width measurement avoids any potential truncation of string values that users enter, since the size measurement on forms and in the databases are then identical.