SetChildren

Sets the rows of a supplied, named parent/child relationship. If rows previously existed under this name, they will be returned to the caller.

Syntax

ASCII Version
DataRow** setChildren(DataRow* dataRow, const char* childName, DataRow** dataRows) 
Unicode Version
DataRow** setChildren(DataRow* dataRow, const UChar* childName, DataRow** dataRows) 

Results

Returns the set of the names of the named parent/child relationships.

Example

ASCII Version
DataRow* dataRow = createDataRow(); 
DataRow* child1DataRow1 = createDataRow();	 
DataRow* child1DataRow2 = createDataRow(); 
DataRow* child2DataRow = createDataRow(); 
DataRow** child2Rows; 
DataRow** returnRows; 

setByName(child1DataRow1, "Address", "200 Congress"); 
setByName(child1DataRow1, "City", "Austin"); 
 
setByName(child1DataRow2, "Address", "100 Congress"); 
setByName(child1DataRow2, "City", "Dallas"); 
 
setByName(child2DataRow, "Address", "100 Congress"); 
setByName(child2DataRow, "City", "Austin"); 
 
addChild( dataRow, "child1", child1DataRow1); 
addChild( dataRow, "child1", child1DataRow2); 
addChild( dataRow, "child2", child2DataRow ); 

child2Rows=getChildren(dataRow, "child2"); 

returnRows=setChildren( dataRow, "child1", child2Rows);
Unicode Version
DataRow* dataRow = createDataRow();
DataRow* child1DataRow1 = createDataRow();
DataRow* child1DataRow2 = createDataRow();
DataRow* child2DataRow	= createDataRow();
DataRow** child2Rows;
DataRow** returnRows;
UChar	name[128];
UChar	columnValue[128];
UChar	childName[128];

setByName(child1DataRow1, convertcharToUChar("Address", name), convertcharToUChar("200 Congress", columnValue));
setByName(child1DataRow1, convertcharToUChar("City", name), convertcharToUChar("Austin", columnValue));
setByName(child1DataRow2, convertcharToUChar("Address", name), convertcharToUChar("100 Congress", columnValue));
setByName(child1DataRow2, convertcharToUChar("City", name) convertcharToUChar("Dallas", columnValue) );
setByName(child2DataRow, convertcharToUChar("Address", name), convertcharToUChar("100 Congress", columnValue) );
setByName(child2DataRow, convertcharToUChar("City", name), convertcharToUChar("Austin", columnValue) );

addChild( dataRow, convertcharToUChar("child1", childName), child1DataRow1);
addChild( dataRow, convertcharToUChar("child1", childName),child1DataRow2);
addChild( dataRow, convertcharToUChar("child2", childName), child2DataRow );

child2Rows=getChildren(dataRow, convertcharToUChar("child2",childName)); 
returnRows=setChildren( dataRow, convertcharToUChar("child1",childName), child2Rows);