Subject | SQLOrder not updated OnPrepareSQL |
---|---|
Author | cwseetoh@singnet.com.sg |
Post date | 2003-12-18T02:12:19Z |
Hi all,
I have a IB_Query, IB_DataSource and IB_Grid. My SQL in IB_Query
is SELECT COY_NAME, CONTACT_PERSON, CONTACT_NO, FAX FROM CUSTOMER. I
have OrderingItems and OrderingLinks setup so that I can sort
COY_NAME or CONTACT_PERSON by clicking on the IB_Grid's title.
Basically everything is working fine.
After reading some tips on optimizing sql, I found out that using
an index to perform ordering slows things down. And to avoid that, we
can change the sql to ORDER BY COY_NAME||''. This will cause the
optimizer to not use the index to sort.
But I noticed that during OnPrepareSQL event, no matter which
field I click to sort, the SQLOrder will not be updated. However
sqlmonitor reveals that the actual statement executed does have an
ORDER BY clause.
I'm using delphi 6, win 2k, ibobjects 4.3a, firebird 1.5 rc7.
Regards,
Alfred
I have a IB_Query, IB_DataSource and IB_Grid. My SQL in IB_Query
is SELECT COY_NAME, CONTACT_PERSON, CONTACT_NO, FAX FROM CUSTOMER. I
have OrderingItems and OrderingLinks setup so that I can sort
COY_NAME or CONTACT_PERSON by clicking on the IB_Grid's title.
Basically everything is working fine.
After reading some tips on optimizing sql, I found out that using
an index to perform ordering slows things down. And to avoid that, we
can change the sql to ORDER BY COY_NAME||''. This will cause the
optimizer to not use the index to sort.
But I noticed that during OnPrepareSQL event, no matter which
field I click to sort, the SQLOrder will not be updated. However
sqlmonitor reveals that the actual statement executed does have an
ORDER BY clause.
I'm using delphi 6, win 2k, ibobjects 4.3a, firebird 1.5 rc7.
Regards,
Alfred