Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this example, the virtual columns COMPNO, DIVNUM and COSTCT could have been derived by using the "Extended definition of a virtual column" function by Substringing the real column into CHTACC OR by entering a few lines of RPG/400 code that mapped column CHTACC into columns COMPNO, DIVNUM and COSTCT.
Once this has been done COMPNO, DIVNUM and COSTCT would appear to be in table ACCMST. However, if the table was examined it would be found that the columns do not actually exist. Hence the name "virtual" columns.
Note that columns COMPNO, DIVNUM and COSTCT are only used when reading (i.e. inputting) from the ACCMST table. When writing to or updating the ACCMST table they have no particular meaning.
This need not be so, in fact virtual columns COMPNO, DIVNUM and COSTCT could be used to "re-assemble" column CHTACC when outputting to the table. This feature of virtual columns is extremely useful in some situations.
Also See
Examples of Virtual Column Applications
Virtual Column Concepts
&<img src="../resources/images/opentoc-dark.png" title="Open Contents List" border="0"&>