Selecting index

Hi,

I wanted to know your opinion about the following code to change the order of the records, is this the fastest way to do, or might there be another better method?:

procedure TMainForm.Button5Click(Sender: TObject);
var strSQL: string;
begin
with datamodule1 do begin
strSQL := 'SELECT a.*,a.rowid FROM lts_po a ORDER BY ID, DWGID';
TOracleDataset1.sql.clear;
TOracleDataset1.sql.add(strSQL);
TOracleDataset1.refresh;
end;
end;
 
The point is, I want to uses a grid and when the user clicks on a cloumn header the table will be sorted on bases of the column. With pdox I used index with a name corresponding with the column name. Is there a way to do this with DOA access as well? I mean use oracle indexes and set the sort order of the table using these indexes?
 
Modifying the where clause is the right way to do this. Just let the Oracle Server figure out what indexes to use.

------------------
Marco Kalter
Allround Automations
 
Back
Top