Subject IB_Query Ordering Problems
Author kj01135
I have a simple query and want to sort this query at runtime. I
assign the SQLOrder property on OnSQLPrepare event but it does not
work.

Here is what I have done:
Query:
select * from items
for update;

OnSQLPrepare event;
if OrderByName then
SQLOrder.Add('LOC_SHOP, NAME')
else
SQLOrder.Add('LOC_SHOP, ITEMCODE');

I want to order the query based on LOC_SHOP and either NAME or
ITEMCODE. When I run the program, I get INVALID TOKEN error.

I tried to use SQLOrderingItems but it seems only work for sorting
single column, may be I'm wrong. Please help!

Regards,
Kenneth Man