XML into multiple tables by hierarchy

Posted by scott_auge on 21-Dec-2016 10:12

I have been putting in key fields to the XML to relate one set of attributes to another set.  I did this because I was unaware of how to use hierarchy to decide where XML data goes into tables.

So, I hear a way is available.

Any suggestions or where to read about it?

All Replies

Posted by Peter Judge on 21-Dec-2016 10:22

Take a look at the doc for the DATASET relations. In particular the PARENT-ID-RELATION stuff

Posted by scott_auge on 21-Dec-2016 10:36

Yea, I got that, but they don't want the keys in the relationship...

Posted by David O'Regan on 21-Dec-2016 10:54

Hi,

The PARENT-ID-RELATION (as opposed to RELATION-FIELDS) option should give you the ability to relate parent/child tables without matching key field pairs.

This is done by storing the RECID of the parent table within the child table and using that as the PARENT-ID-RELATION.

(As a side note i'm a little unsure of why this method of linking tables requires the use of RECID (as opposed to ROWID). I was under the impression RECID was a deprecated feature super ceded by ROWID. Am I mistaken?)

Does this help?

Best Regards,

David

Posted by scott_auge on 21-Dec-2016 12:47

Yes!

Posted by gus bjorklund on 22-Dec-2016 18:44

> On Dec 21, 2016, at 11:57 AM, David O'Regan wrote:

>

> I was under the impression RECID was a deprecated feature super ceded by ROWID

As a practical matter, RECID and ROWID are the same thing. Though RECID was deprecated, regardless of what product management might say, it can never be removed and must continue to function properly in current and future versions of the 4GL.=

Posted by David O'Regan on 23-Dec-2016 03:16

That's how I understood things too, which is why it struck me as odd that PARENT-ID-RELATION explicitly states you must use RECID and can't use ROWID.

An odd quirk, I guess.

Thanks for confirming.

Posted by gus bjorklund on 23-Dec-2016 06:40

well, though i said they are the same thing, there are some differences in how they can be used. rowid can’t be converted to an integer directly as recid can.

this is because though they are the same thing in OpenEdge databases, a rowid in a dataserver database is NOT the same thing. For example, in an Oracle dataserver they are a byte strings that are not convertible to 64 bit integers because they are bigger than that and won’t fit.

Posted by David O'Regan on 23-Dec-2016 07:11

Interesting. Thanks for the explanation, I was unaware of this (or any) difference in the two.

Good to know!

Posted by Laura Stern on 23-Dec-2016 07:13

Also newer features may require ROWID.  It is only older, "legacy" code that was already using RECID that is guaranteed to work.

Posted by David O'Regan on 23-Dec-2016 07:26

That's the interesting thing. PARENT-ID-RELATION is a new feature, i believe (11.3+ i think?).

Just found this article:

knowledgebase.progress.com/.../parent-id-relation-uses-recid-instead-of-rowid

So it seems that it's possible it will be changed to accept ROWID in the future and that there isn't a specific reason it uses RECID at the moment.

This thread is closed