ADD-RELATION ( parent-buffer-handle , child-buffer-handle ,
[ pairs-list [ , reposition-mode [ , nested [ , not-active [ , recursive
[ , foreign-key-hidden ] ] ] ] ] ])
|
"parent-field1,child-field1[,parent-fieldn,child-fieldn]..."
|
When navigating a filled ProDataSet object with a SELECTION relation, related data is filtered as it is browsed. This means the child query of the relation is filtered to make available only children of the current parent, and the query is re-opened each time the parent table is repositioned. When navigating a filled ProDataSet object with a REPOSITION relation, the child table query is always set to match all the rows in the child table, and is not re-opened when the parent changes. Only the buffer for the child is repositioned to the matching child for the current parent.
A LOGICAL expression where TRUE directs the AVM to nest child rows of ProDataSet buffers within their parent rows when writing the XML representation of data. This also causes the XML Schema definitions for the related temp-tables to be nested. When FALSE, all child rows are written after all parent rows are written. The default value is FALSE.
An optional LOGICAL expression where TRUE causes the data-relation to be filled recursively. This mode instructs the ProDataSet FILL to load self-referencing elements. That is, an element can reference a child element that already either directly or indirectly references the parent element in the hierarchy. Examples of this hierarchy are bill-of-materials parent/child tables or organization chart manager/employee relationship tables.
An optional LOGICAL expression where TRUE directs the AVM to omit foreign key fields in nested data-relations when writing the XML representation of data. This also causes the XML Schema definition for the ProDataSet to indicate that the foreign key fields are optional. Since the parent record in a nested relationship contains the foreign key, suppressing it in the nest child record is efficient. If this option is used, the NESTED argument must be TRUE.
Care must be taken when deciding to use this feature. The READ-XML( ) method automatically populates foreign keys in nested child records with the values in the outer parent record when the foreign key is omitted from the XML document. Unless you are sure that the receiver of the XML document will do the same, you should not use this option in your nested data-relations.
For example, while .NET can read this XML document and populate an ADO .NET DataSet, it will create rows in the child DataTable with a null value for the foreign key fields.