deepatpaul
Programmer
I'm having difficulty appending the results of one query set to another. I'm getting null values but the recordcount is accurate (adding both queries separate versus the new query total). Here's what I did:
<cfset qRefineSearch = QueryNew("projectID,projectTitle,isNamePrivate") />
<cfscript>
j = 0;
// If one of the primary search queries, loop over the resultset first
if (isQuery(qGetDiseasePrimary) and (qGetDiseasePrimary.RecordCount gt 0))
{
For (i=1;i LTE qGetDiseasePrimary.RecordCount; i=i+1)
{
temp = QueryAddRow(qRefineSearch);
temp = QuerySetCell(qRefineSearch, "projectID", qGetDiseasePrimary.projectID, i);
temp = QuerySetCell(qRefineSearch, "projectTitle", qGetDiseasePrimary.projectTitle, i);
temp = QuerySetCell(qRefineSearch, "isNamePrivate", qGetDiseasePrimary.isNamePrivate, i);
}
}
// Then, add the remaining resultset to complied list (if there are any)
For (i=1;i LTE qSearchRest.RecordCount; i=i+1)
{
j = i + qSearchRest.RecordCount;
temp = QueryAddRow(qRefineSearch);
temp = QuerySetCell(qRefineSearch, "projectID", qSearchRest.projectID, j);
temp = QuerySetCell(qRefineSearch, "projectTitle", qSearchRest.projectTitle, j);
temp = QuerySetCell(qRefineSearch, "isNamePrivate", qSearchRest.isNamePrivate, j);
}
</cfscript>
Ideas? The 2nd For loop is only inserting about half the recordset correctly, and the rest of the results (when viewing output) are null.
<cfset qRefineSearch = QueryNew("projectID,projectTitle,isNamePrivate") />
<cfscript>
j = 0;
// If one of the primary search queries, loop over the resultset first
if (isQuery(qGetDiseasePrimary) and (qGetDiseasePrimary.RecordCount gt 0))
{
For (i=1;i LTE qGetDiseasePrimary.RecordCount; i=i+1)
{
temp = QueryAddRow(qRefineSearch);
temp = QuerySetCell(qRefineSearch, "projectID", qGetDiseasePrimary.projectID, i);
temp = QuerySetCell(qRefineSearch, "projectTitle", qGetDiseasePrimary.projectTitle, i);
temp = QuerySetCell(qRefineSearch, "isNamePrivate", qGetDiseasePrimary.isNamePrivate, i);
}
}
// Then, add the remaining resultset to complied list (if there are any)
For (i=1;i LTE qSearchRest.RecordCount; i=i+1)
{
j = i + qSearchRest.RecordCount;
temp = QueryAddRow(qRefineSearch);
temp = QuerySetCell(qRefineSearch, "projectID", qSearchRest.projectID, j);
temp = QuerySetCell(qRefineSearch, "projectTitle", qSearchRest.projectTitle, j);
temp = QuerySetCell(qRefineSearch, "isNamePrivate", qSearchRest.isNamePrivate, j);
}
</cfscript>
Ideas? The 2nd For loop is only inserting about half the recordset correctly, and the rest of the results (when viewing output) are null.