Re:BDE Able to sort a Qry result set??
Glenn,
You can try storing your query results in a temporary table, and
performing your sorts on that temporary table.
In my application (to MS SQL 6.5), the user searches for a customer and
the result set is returned in a DBGrid (InfoPower DBGrid with title buttons
to be more exact). The user wanted to be able to sort by clicking on the
column title, both ascending and descending (very Explorer like). No
problem, but executing the same query, ascending and descending, over
800,000 records did take some time. I used temporary tables to solve this
problem.
For example:
MyQuery.SQL.Add('Select * into #Temp');
MyQuery.SQL.Append('from Customers');
MyQuery.SQL.Append('Where FirstName = "Kevin" ');
MyQuery.Prepare;
MyQuery.Open;
{ other code .....}
.
MyQuery.Close;
MyQuery.SQL.Clear;
MyQuery.SQL.Add('Select * from #Temp');
MyQuery.Prepare;
MyQuery.Open;
- and from there just appended the 'ORDER BY <field name>' and re-executed
the query. Performance is very fast, but I found this could fill up tempdb
if users execute querys that return large datasets (like getting every
customer with first name of Kevin)
I hope this helps.
Good luck,
krf
Glenn Casteran <Lag...@{*word*104}Force.com> wrote in article
<348CCD31.1...@{*word*104}Force.com>...
Quote
> Is it possible for the BDE to sort a query result set returned from a
> SQL Anywhere server?
> I know I can get the server to sort it before it sends the data but I
> have a need to change the order after it arrives.
> Thanks,
> Glenn.