Search code examples
t-sqlsybasesap-ase

Sybase: FOR BROWSE and ORDER BY


I have table with primary key "id" (in test table id from 2 to 5). If I using query like

 select * from sometable order by id DESC

result sorted as expected from 5 to 2. But if I add FOR BROWSE like

select * from sometable order by id DESC FOR BROWSE

result sorted from 2 to 5. I checked that also in Interactive SQL.

Is it possible to get proper DESC order with FOR BROWSE? Because FOR BROWSE crucial for me: with direct access to server without drivers it sends TDS_COLINFO (table names by fields, also can be retrieved from TDS_ROWFMT2) token and proper flags for key fields (also can be retrieved as meta table info, but requires additional requests from server I'm trying to avoid).


Solution

  • From SAP support:

    This is a known defect, CR 710333, no estimate for when it will be fixed.

    It seems bug reported since ASE 15.7.