rspec/rules/S1481/plsql/rule.adoc

51 lines
864 B
Plaintext
Raw Normal View History

include::../rationale.adoc[]
include::../how-to-fix-it.adoc[]
=== Code examples
==== Noncompliant code example
[source,sql,diff-id=1,diff-type=noncompliant]
----
DECLARE
seconds INTEGER := 0; -- Noncompliant - seconds is unused
hours INTEGER := 2;
BEGIN
minutes := hours * 60;
DBMS_OUTPUT.PUT_LINE('Number of minutes: ' || minutes);
END;
----
==== Compliant solution
[source,sql,diff-id=1,diff-type=compliant]
----
DECLARE
hours INTEGER := 2;
BEGIN
minutes := hours * 60;
DBMS_OUTPUT.PUT_LINE('Number of minutes: ' || minutes);
END;
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Remove the unused local constant/exception/variable "xxx".
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]