Virtual Column Considerations
Following are some important considerations when using virtual columns:
- More complex virtual columns can also be defined using 3GL code. The 3GL code will be written in RPG for the IBM i and in C for Windows (other platforms). If you are building applications which will execute on more than one platform, you must be very careful with 3GL code. For more information about creating virtual columns using 3GL code, please refer to Virtual Fields in the User Guide.
- Remember to follow the column naming standards so that virtual columns will end in a 3 character suffix of "VIR". This will help developers identify a column as a virtual column. (Refer to Field Naming Standards.)
- Virtual columns are derived and are not real columns in the table. Virtual columns cannot be used as a key column for a physical table or an index. If you require columns for these purposes, you will need to make them into real columns as opposed to virtual columns.
- For the most part, LANSA treats the virtual columns like any other column in the table. You can add column and table level validation rules to a virtual column. If the table is being used for output, the validation rules should be specified on the virtual column and not the real column. You may encounter difficulties if you have validation rules on the real column but use virtual columns as before output to write to the table.
Virtual Column Definition in the Technical Reference Guide
Table Columns Tab in the Visual LANSA User Guide.