The Business Rules Engine

Types

Create Type

create_type := CREATE TYPE <type_name> AS ( 
               <type_property> = '<property_value>' , 
               <type_property> = '<property_value>' 
               )
type_property := VALIDATION_MASK | SAVE_MASK

Creates a new system type.

For each type, the following two properties must be defined:

  • Validation Mask: A Regular Expression that matches all valid strings for this data type.
  • Save Mask: A Regular Expression that formats strings matched by the validation mask so that they can be properly stored in the database.

All Regular Expressions are of the Perl variety and use the / syntax. The conversion from the validation mask to the save mask is done using regex substitution, and patterns are supported.

All user-defined datatypes in Coda at the time of this writing are limited to strings of no greater than 250 characters. If larger sizes are needed, the built-in, unformatted LONGSTRING or FILE types must be used instead.

Alter Type

alter_type := ALTER TYPE <type_name> SET 
              <type_property> = '<property_value>' , 
              <type_property> = '<property_value>'
type_property := VALIDATION_MASK | SAVE_MASK

Alters an existing system type.

As with CREATE TYPE, both VALIDATION_MASK and SAVE_MASK must be specified, although the order is unimportant. Both properties are Perl Regular expressions using / syntax.

Drop Type

drop_type := DROP TYPE <type_name>

Removes a type from the system. You can later define a new type with the same name if you choose.