The COMPUTED BY DATATRIEVE field attribute clause supplies expressions used by VAX DATATRIEVE to calculate the values of VIRTUAL fields.
1 – cbd_quoted_string
An expression used by VAX DATATRIEVE to calculate the field's value. The set of quoted strings must form a valid VAX DATATRIEVE virtual expression. The CDDL compiler does not check the virtual expression for correct syntax. You must provide a correct virtual expression.
2 – Usage Notes
o You must specify a VIRTUAL FIELD DATATYPE for a field using the COMPUTED BY DATATRIEVE clause. o Only VAX DATATRIEVE can interpret VIRTUAL fields. Other processors either ignore their presence or refuse to process record descriptions containing them. o You can use 8-bit characters in CDDL quoted strings. o You cannot specify an INITIAL VALUE field attribute for a virtual field. o You cannot specify a CONDITION NAME field attribute for a virtual field. o You cannot use a virtual field as a tag variable in the VARIANTS OF field description statement.
3 – Example
No storage has been allocated here for TOTAL_PRICE. Instead, VAX DATATRIEVE uses the virtual expression "UNIT_PRICE * QUANTITY" to calculate the value of TOTAL_PRICE at run time. TOTAL_PRICE DATATYPE IS VIRTUAL FIELD COMPUTED BY DATATRIEVE AS "UNIT_PRICE * QUANTITY".