rspec/rules/S3626/plsql/rule.adoc
2022-02-04 16:28:24 +00:00

45 lines
888 B
Plaintext

Jump statements, such as ``++RETURN++`` and ``++CONTINUE++`` let you change the default flow of program execution, but jump statements that direct the control flow to the original direction are just a waste of keystrokes.
== Noncompliant Code Example
[source,sql]
----
CREATE PROCEDURE print_numbers AS
BEGIN
FOR i in 1..4 LOOP
DBMS_OUTPUT.PUT_LINE(i);
CONTINUE; -- Noncompliant
END LOOP;
RETURN; -- Noncompliant
END;
----
== Compliant Solution
[source,sql]
----
CREATE PROCEDURE print_numbers AS
BEGIN
FOR i in 1..4 LOOP
DBMS_OUTPUT.PUT_LINE(i);
END LOOP;
END;
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../highlighting.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]