Problem in lucee/cfml/Query.cfc

I’m running Lucee, and have run into a problem. The error message states:
Missing [;] or [line feed] after expression

The execution trace ends at lucee/components/org/lucee/cfml/Query.cfc line 196

My statement causing the failure is as follows:

local.sortedQuery = new Query(
				sql = "select * from highlights order by insertTimestamp,
				endChildNode desc, endPosition desc, startChildNode desc,
				startPosition desc",
				dbtype = "query",
				highlights = local.qHighlights );


Marilou Landes

I don’t know why you’re getting the error, but here’s a simpler way of sorting your query which may bypass the issue:

local.sortedQuery = local.qHighlights.sort( "insertTimestamp,endChildNode,endPosition,startChildNode,startPosition", "asc,desc,desc,desc,desc" );
1 Like

Wonderful! It’s working as expected. Thank you

What does HIGHLIGHTS do?

Highlights is a query; each record in the query contains the timestamp when the data was inserted to the database, and the beginning and ending position for the “highlight”; as in highlighted text in an article or chapter.

1 Like