rspec/rules/S1005/plsql/rule.adoc
2021-06-02 20:44:38 +02:00

27 lines
757 B
Plaintext

Procedures, unlike functions, do not return values. The ``++RETURN++`` statement therefore, when used within a procedure, is used to prematurely end the procedure. However, having multiple exit points (i.e. more than the ``++END++`` of the procedure itself), increases the complexity of the procedure and makes it harder to understand and debug.
== Noncompliant Code Example
----
SET SERVEROUTPUT ON
DECLARE
PROCEDURE prcoedureWithReturn AS
BEGIN
RETURN; -- Noncompliant
DBMS_OUTPUT.PUT_LINE('prcoedureWithReturn called'); -- This is actually unreachable
END;
BEGIN
prcoedureWithReturn;
END;
/
----
ifdef::rspecator-view[]
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::rspecator-view[]