Previous Topic: TABLE_INFO StatementNext Topic: Object Definition Syntax


Mapping Statement

Defines the correspondence between the logical tables and columns in the CA SDM database schema and the physical tables and columns used by your database management system. This statement follows each TABLE statement in a.sch file. You must define it when you define a new table.

Syntax

p1 logical_table_name -> CURR_PROV physical_table_name 
   [{logical_field -> physical_field ...] ;

[}]

Arguments

p1

Introduces the mapping statement. Must be specified as p1.

logical_table_name

The name of the database table in the TABLE statement, for example, zManufacturer.

CURR_PROV

A required keyword.

physical_table_name

The name of the table used by your database management system, for example, man. Short names improve performance and are required by some database management systems.

logical_field

The name of the column in the CA SDM database schema, for example, desc. Must be the same as field in the TABLE statement. Omit this when the logical columns and physical columns have identical names. When omitted, the semicolon follows physical_table_name.

physical_field

The name of the column used by your database management system, for example, nx_desc. Omit this when the logical columns and physical columns have identical names. When omitted, the semicolon follows physical_table_name.

Examples

This example illustrates how TABLE, mapping (p1), and TABLE_INFO statements define a zManufacturer table:

TABLE zManufacturer {
        id       INTEGER  uniq KEY;       // key id
        del      INTEGER  nn;             // 0=present,1=gone
        sym      HIER_SYM uniq S_KEY;     // manufacturer name
        desc     ENT_DESC;                // manufacturer description
}

p1 zManufacturer -> CURR_PROV man   // maps logical table "zManufacturer"
{                                  // to physical table "man"
        desc -> nx_desc;           // maps logical column "desc"
}                                  // to physical column "nx_desc"

TABLE_INFO zManufacturer {

STORAGE HASH id;
INDEX SORT ASCENDING PRIMARY UNIQUE sym;
}