I have an XML file, that I bring into a dataset that has 4 temp-tables. I CAN see the data in the temp-tables, BUT where I am confused (LOST) is the fact that I don't see the below process creating the relationships between the temp-tables. I would expect the "parentid" fields to be populated with a RECID, and thus create my relationships. So if all my "parentid" fields are "?" (null) I don't have any good join from ga_export to ga_journal or ga_journal to ga_deposit or ga_deposit to ga_bank.
NOTE: this is a 10.1C04 version of Progress. From what I can read (and experience is showing me), trying FIELD parentid AS RECID SERIALIZE-HIDDEN does not work in this version. Any reference to "SERIALIZE", anywhere throws errors.
Also note that I cannot control the XML format or content. It is just my job to read it and get it into these related temp-tables and go from there.
Below is the code (only the highlights, I hope this is enough):
define temp-table ga_export NO-UNDO
FIELD parentid AS RECID
.
define temp-table ga_journal
field parentid as recid
field ga_journal_id as int
~~~
.
define temp-table ga_deposit
field parentid as recid
field ga_deposit_id as int
~~~
.
define temp-table ga_bank
field parentid as recid
field ga_name as character
~~~
.
DEFINE DATASET dsGAExport FOR ga_export, ga_journal, ga_receipt, ga_deposit, ga_bank
DATA-RELATION drexju FOR ga_export, ga_journal RELATION-FIELDS (parentid, parentid)
DATA-RELATION drjude FOR ga_journal, ga_deposit RELATION-FIELDS (parentid, parentid)
DATA-RELATION drdeba FOR ga_deposit, ga_bank RELATION-FIELDS (parentid, parentid)
.
lRetOK = DATASET dsGAExport:READ-XML(cSourceType, outFileName, cReadMode, cSchemaLocation,
lOverrideDefaultMapping, cFieldTypeMapping, cVerifySchemaMode).
XML Example:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ga_export>
<ga_journal>
<ga_journal_id>29</ga_journal_id>
<ga_deposit>
<ga_deposit_id>6</ga_deposit_id>
<ga_bank>
<ga_name>Bobs Bank</ga_name>
</ga_bank>
</ga_deposit>
<ga_exportTimestamp>20170426163505</ga_exportTimestamp>
</ga_journal>
</ga_export>
NOTE: this is a 10.1C04 version of Progress. From what I can read (and experience is showing me), trying FIELD parentid AS RECID SERIALIZE-HIDDEN does not work in this version. Any reference to "SERIALIZE", anywhere throws errors.
Also note that I cannot control the XML format or content. It is just my job to read it and get it into these related temp-tables and go from there.
Below is the code (only the highlights, I hope this is enough):
define temp-table ga_export NO-UNDO
FIELD parentid AS RECID
.
define temp-table ga_journal
field parentid as recid
field ga_journal_id as int
~~~
.
define temp-table ga_deposit
field parentid as recid
field ga_deposit_id as int
~~~
.
define temp-table ga_bank
field parentid as recid
field ga_name as character
~~~
.
DEFINE DATASET dsGAExport FOR ga_export, ga_journal, ga_receipt, ga_deposit, ga_bank
DATA-RELATION drexju FOR ga_export, ga_journal RELATION-FIELDS (parentid, parentid)
DATA-RELATION drjude FOR ga_journal, ga_deposit RELATION-FIELDS (parentid, parentid)
DATA-RELATION drdeba FOR ga_deposit, ga_bank RELATION-FIELDS (parentid, parentid)
.
lRetOK = DATASET dsGAExport:READ-XML(cSourceType, outFileName, cReadMode, cSchemaLocation,
lOverrideDefaultMapping, cFieldTypeMapping, cVerifySchemaMode).
XML Example:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ga_export>
<ga_journal>
<ga_journal_id>29</ga_journal_id>
<ga_deposit>
<ga_deposit_id>6</ga_deposit_id>
<ga_bank>
<ga_name>Bobs Bank</ga_name>
</ga_bank>
</ga_deposit>
<ga_exportTimestamp>20170426163505</ga_exportTimestamp>
</ga_journal>
</ga_export>