Dynamic to Static Dataset copy

Posted by davidkerkhofs3 on 16-Dec-2013 04:46

OE11.3.1 / Win32 Following error occurs: COPY-TEMP-TABLE requires and columns to match exactly unless the fourth loose-mode parameter is passed as TRUE. (12303) What I'm doing is this: #defvars and fill dsTest left out DATASET dsTest:WRITE-XML("file","test.xml",?). CREATE DATASET hDS. hDS:READ-XML("file","test.xml","empty",?). DATASET dsTest:EMPTY-DATASET(). DATASET dsTest:HANDLE:COPY-DATASET(hDS). Solution as proposed by error message makes it work with some datasets but others fail (without errors, just no data copied). DATASET dsTest:HANDLE:COPY-DATASET(hDS,FALSE,FALSE,TRUE). Anybody experienced something similar when trying to copy a "compliant" dynamic dataset into a static dataset? Thanks for any pointers.

All Replies

Posted by mallen on 18-Dec-2013 09:19

The 4GL has to infer the datatypes from the XML dynamically so generally everything is created as character and with any of the native COPY commands, the datatype and extent has to match. That's why you have to loose copy in order to ignore those that don't match.

Include the schema in the output and you won't need the "loose".

DATASET dsTest:WRITE-XML("file","test.xml",TRUE,?,?,TRUE).

This thread is closed