Kbase P126082: How to add fields to a dynamic temp-table created with READ-XMLSCHEMA method ?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/1/2007 |
|
Status: Unverified
GOAL:
How to add fields to a dynamic temp-table created with READ-XMLSCHEMA method ?
GOAL:
Is it possible to modify a temp-table's schema when it is loaded with READ-XMLSCHEMA method ?
GOAL:
How to create a dynamic temp-table based on an xsd file with additional fields ?
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.1x
FIX:
It is not directly possible to add fields or indexes to a dynamic temp-table created with READ-XMLSCHEMA method, as this method puts the temp-table in the PREPARED state, based on the assumption that a temp-table created this way should be an exact match to the definitions in the XML Schema Definition.
It is also not possible to add fields to the dynamic temp-table before calling the READ-XMLSCHEMA method.
In order to obtain a dynamic temp-table based on an XSD, but with added fields a number of additional steps are required. The code should follow these steps:
1. Create a dummy temp-table object and load the XSD using READ-XMLSCHEMA method
2. Create a second (actual) temp-table object, and add the definitions of the dummy using the CREATE-LIKE method. Note that this does not put the actual temp-table in the PREPARED state yet.
3. Add the additional fields to the second temp-table and TEMP-TABLE-PREPARE it.
4. Delete the dummy temp-table as it is no longer required at this point.
The actual temp-table can then be used for further processing.