Types of Virtual Columns
LANSA provides two methods of defining virtual columns:
-
LANSA extended definitions
-
RPG or C program coded definitions.
LANSA's extended definitions allow you to perform:
-
Substringing. For details, refer to Substring in the Technical Reference Guide.
-
Concatenation. For details, refer to Concatenation in the Technical Reference Guide.
-
Mathematical calculations. For details, refer to Mathematical Calculations in the Technical Reference Guide.
-
Date conversion. For details, refer to Date Conversion in the Technical Reference Guide.
-
Code Fragment. For details, refer to Code Fragment in the Technical Reference Guide.
RPG or C coded definitions (refer to Virtual Column Derivation in the Technical Reference Guide) may be necessary for complex actions such as:
-
type and length conversions
-
date to age conversions
-
dynamic data conversion.
LANSA trigger functions may also be used to create virtual columns. Trigger functions use RDML and provide an alternate option to using RPG or C for coding the virtual column logic.
A virtual column must be defined in the Repository and may have column and table level validations associated with it. Also, validation rules for the columns used in defining the virtual column are still enforced. A virtual column can be used like any other column in the Repository.
Virtual columns are not part of the real table and cannot be directly used outside of LANSA. Virtual columns are made possible using LANSA's Object Access Module. Client applications using LANSA Open and any applications which use the LANSA Object Access Module can access the LANSA virtual columns.
Also See