Enum / Struct in a Union

You can use an enum or a struct in a union using a composition association. The composition allows you to define the struct as a case in the union.



union Customer switch(short) {
 case XYZ:
  char Last_Name;
 case ZYX:
  char Name;
 default:
  Identification uses;
};

The name of the attribute is on the association role and the case is on the association.


Created October 7, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com