CDO$HELP.HLB  —  CDO Commands, DEFINE  RECORD Variants, Examples
  CDO>  DEFINE RECORD PRODUCT_INVENTORY.
  cont>   FIELD_ID.
  cont>     VARIANTS.
  cont>       VARIANT EXPRESSION IS
  cont>         FIELD_ID IN PRODUCT_INVENTORY EQ "S".
  cont>         IN_STOCK STRUCTURE.
  cont>           PRODUCT_NO.
  cont>           DATE_ORDERED.
  cont>           STATUS_CODE.
  cont>           QUANTITY.
  cont>           LOCATION.
  cont>           UNIT_PRICE.
  cont>         END IN_STOCK STRUCTURE.
  cont>       END VARIANT.
  cont>       VARIANT EXPRESSION IS
  cont>         FIELD_ID IN PRODUCT_INVENTORY EQ "B".
  cont>         BACK_ORDER STRUCTURE.
  cont>           PRODUCT_NO.
  cont>           DATE_ORDERED.
  cont>           STATUS_CODE.
  cont>           QUANTITY.
  cont>           SUPPLIER.
  cont>           UNIT_PRICE.
  cont>         END BACK_ORDER STRUCTURE.
  cont>       END VARIANT.
  cont>       VARIANT EXPRESSION IS
  cont>         FIELD_ID IN PRODUCT_INVENTORY EQ "O".
  cont>         OUT_OF_STOCK STRUCTURE.
  cont>           PRODUCT_NO.
  cont>           DATE_LAST_SOLD.
  cont>         END OUT_OF_STOCK STRUCTURE.
  cont>       END VARIANT.
  cont>     END VARIANTS.
  cont> END RECORD.

      In this example, the DEFINE RECORD command creates the PRODUCT_
      INVENTORY record element, which contains a variants definition
      consisting of three structure definitions. Each structure
      definition uses an expression whose value is compared to
      the value of the tag variable (FIELD_ID field definition) at
      runtime to determine which structure definition maps to the
      record element.
Close Help