rspec/rules/S1005/plsql/rule.adoc

35 lines
874 B
Plaintext
Raw Normal View History

2021-01-27 13:42:22 +01:00
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.
2020-06-30 12:47:33 +02:00
== 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::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]