GETDATAMAPPING Column Constraint

From Lianjapedia
Jump to: navigation, search

Purpose

Column constraint to specify the display data mapping for a column

Syntax

SET GETDATAMAPPING <expC>

See Also

ALTER TABLE, CONSTRAINTS, CREATE TABLE, Data Mapping, FIELDCHOICES(), GETDATAMAPPING(), INDEX, KEYLOOKUP(), SETDATAMAPPING(),

Description

A constraint is used to define rules that help to provide data integrity. Column constraints are specific to the column name specified. You must have ALTER privilege on the table. The table will be locked for EXCLUSIVE use during the operation.

The GETDATAMAPPING column constraint is used to specify the display data mapping for a column.

Example

open database southwind
alter table "products" modify constraint supplierid;
         set choices 'select companyname from suppliers order by companyname'
alter table "products" modify constraint supplierid:
        set getdatamapping 'keylookup("suppliers", "supplierid",{}, companyname)'
alter table "products" modify constraint supplierid;
        set setdatamapping 'keylookup("suppliers", "companyname","{}", supplierid)'