QueryRowDataByIndex()
Introduced: 5.3.4.34
QueryRowDataByIndex( query=query, index=string, defaultValue=struct );
Returns: Struct
Examples
<cfscript>
q_tag = queryNew("tag,id")
tags = getTagList();
loop collection="#tags.cf#" item="tag" {
r = queryAddRow(q_tag);
QuerySetCell(q_tag,"tag", tag, r);
QuerySetCell(q_tag,"id", r, r);
}
</cfscript>
<cfquery name="q_tags_indexed" indexName="tag" dbtype="query">
select * from q_tag
</cfquery>
<cfscript>
//dump(q_tags_indexed);
dump(queryRowByIndex(q_tags_indexed, "query", -1));
def = {tag:"unknown", id:"-1"};
dump(queryRowDataByIndex(q_tags_indexed, "query", def));
dump(queryGetCellByIndex(q_tags_indexed, "query", "id", -1));
</cfscript>
See also
- Queries
- QueryRowByIndex()
- query.rowDataByIndex()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)