rspec/rules/S1005/plsql/rule.adoc
2021-01-27 13:42:22 +01:00

20 lines
619 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;
/
----