TYPE

Types define a synonym for a base or structured data type.

Syntax:

[PUBLIC|PRIVATE] TYPE type-definition [,...]

where type-definition is:

identifier {
   {
     datatype
   |
     LIKE [dbname:]tabname.colname
   }
   [ ATTRIBUTES( attribute [ = "value" ] [,...] ) ]
  1. identifier is the name of the type to be defined.
  2. datatype is any data type, record structure, or array definition supported by the language.
  3. attribute is an attribute to extend the type definition with properties.
  4. value is the value for the type attribute, it is optional for boolean attributes.

Usage

User-defined types enforce reusability and simplify programming, by centralizing data structure definitions at a single place.

When defining types with the LIKE clause, the data types are taken from the database schema file at compile time. Make sure that the schema file of the database schema during development corresponds to the database schema of the production database; otherwise the types defined in the compiled version of your modules will not match the table structures of the production database.

Types can be defined with the ATTRIBUTES() clause, to specify meta-data information for the type. This feature is especially used when defining types for XML-based Web Services. For more details about XML attributes, see Attributes to customize XML serialization.