rspec/rules/S2530/plsql/rule.adoc

32 lines
523 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
``++ASC++`` or ``++DESC++`` should be specified for every column of an ``++ORDER BY++`` clause to improve readability.
== Noncompliant Code Example
----
BEGIN
SELECT col1, col2, col3
BULK COLLECT INTO result
FROM my_table
ORDER BY
col1 ASC,
col2, -- Noncompliant - ASC or DESC should be specified
col3 DESC;
END;
/
----
== Compliant Solution
----
BEGIN
SELECT col1, col2, col3
BULK COLLECT INTO result
FROM my_table
ORDER BY
col1 ASC,
col2 ASC,
col3 DESC;
END;
/
----