//this function will return the rows from the parent result sets
private ExecRow getNextParentRow() throws StandardException
{
ExecRow cRow;
TemporaryRowHolder rowHolder;
if(sourceOpened[sArrayIndex] == 0)
{
rowHolder = sourceRowHolders[sArrayIndex];
source = (TemporaryRowHolderResultSet)rowHolder.getResultSet();
source.open(); //open the cursor result set
sourceOpened[sArrayIndex] = -1;
sourceResultSets[sArrayIndex] = source;
}
if(sourceOpened[sArrayIndex] == 1)
{
source = sourceResultSets[sArrayIndex];
source.reStartScan(sourceRowHolders[sArrayIndex].getTemporaryConglomId(),
sourceRowHolders[sArrayIndex].getPositionIndexConglomId());
sourceOpened[sArrayIndex] = -1;
}
if(sVector.size() > sourceRowHolders.length)
{
addNewSources();
}
cRow = source.getNextRow();
while(cRow == null && (sArrayIndex+1) < sourceRowHolders.length)
{
//opening the next source;
sArrayIndex++;
if(sourceOpened[sArrayIndex] == 0)
{
rowHolder = sourceRowHolders[sArrayIndex];
source = (TemporaryRowHolderResultSet)rowHolder.getResultSet();
source.open(); //open the cursor result set
sourceOpened[sArrayIndex] = -1;
sourceResultSets[sArrayIndex] = source;
}