As a part of a referential integrity check

Visual LANSA Framework

As a part of a referential integrity check

Code tables may be used to define standard referential integrity checks in the LANSA repository or in LANSA RDML functions. For example you might need to check that a state code "NT"  that has arrived from someone else's application is a valid state code. 

Only tables with data that is stored in a physical file (either user defined or the generic Framework table storage file FPTAB) allow referential integrity checks.

In the RDML, a check against a code table named VF_STATES would look like:

*Use the logical view (kya) keyed by: 

*Table name, AKey1, Nkey1, AKey2, Nkey 2, Akey3, Nkey3 ..., field name  

CHECK_FOR in_file(FPTABkya) with_key('VF_STATES' 'NT') IF_STATUS *EQUALKEY

...

ENDIF

 

A LANSA file validation check against the employee table would look like this