rspec/rules/S2530/plsql/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

51 lines
771 B
Plaintext

== Why is this an issue?
``++ASC++`` or ``++DESC++`` should be specified for every column of an ``++ORDER BY++`` clause to improve readability.
=== Noncompliant code example
[source,sql]
----
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
[source,sql]
----
BEGIN
SELECT col1, col2, col3
BULK COLLECT INTO result
FROM my_table
ORDER BY
col1 ASC,
col2 ASC,
col3 DESC;
END;
/
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Add "ASC" or "DESC" to this "ORDER BY".
endif::env-github,rspecator-view[]