ATC Does Not Flag Every SELECT Without ORDER BY

The ATC check for SELECT/OPEN CURSOR without ORDER BY is not a complete inventory of every SQL statement missing an ordering clause. SAP KBA 3732656 explains that its findings are heuristic.

What the check looks for

The check targets constructions that appear to rely on implicit primary-key ordering previously observed on common row-store databases. That ordering is not guaranteed on a column-store database such as SAP HANA.

It reports patterns its heuristics identify as problematic, rather than every SELECT with no ORDER BY.

Review ordering requirements explicitly

If later logic depends on row sequence, inspect how the data is selected and consumed even when ATC reports no finding. An absent finding does not guarantee a stable result order.

Use an appropriate explicit database ordering or a deliberate internal-table sort where the application requires one. Review SAP Note 2315679 for the related ordering guidance and validate the behavior with representative data.

SAP Note 2315679

SAP Note

SAP Note 3732656

You May Also Like

Leave a Reply?