
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.
57 lines
1.1 KiB
Plaintext
57 lines
1.1 KiB
Plaintext
== Why is this an issue?
|
|
|
|
From the Oracle docs:
|
|
|
|
____
|
|
Do not put a single-line comment in a PL/SQL block that will be processed dynamically by an Oracle Precompiler program. The Oracle Precompiler program ignores end-of-line characters, which means that a single-line comment will end at the end of the block.
|
|
____
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,sql]
|
|
----
|
|
DECLARE
|
|
howmany NUMBER;
|
|
num_tables NUMBER;
|
|
BEGIN
|
|
-- Begin processing
|
|
SELECT COUNT(*) INTO howmany
|
|
FROM USER_OBJECTS
|
|
WHERE OBJECT_TYPE = 'TABLE'; -- Check number of tables
|
|
num_tables := howmany; -- Compute some other value
|
|
END;
|
|
/
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,sql]
|
|
----
|
|
DECLARE
|
|
howmany NUMBER;
|
|
num_tables NUMBER;
|
|
BEGIN
|
|
/* Begin processing */
|
|
SELECT COUNT(*) INTO howmany
|
|
FROM USER_OBJECTS
|
|
WHERE OBJECT_TYPE = 'TABLE';
|
|
num_tables := howmany;
|
|
END;
|
|
/
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Convert this single-line comment into a multi-line comment
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|