TYPE

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

Syntax

[PUBLIC|PRIVATE] TYPE
  identifier type-specification
  [,...]
  1. identifier is the name of the type to be defined, that must follow the convention for identifiers.
  2. type-specification can be one of:

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 referencing data types can use the ATTRIBUTES() clause, to specify meta-data information for the type member. 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.

Function reference types can be used to define program variables, that will hold a function reference. See Function references for more details.