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

14 lines
472 B
Plaintext

You should avoid declaring a cursor inside a ``++PERFORM++`` statement because doing so could impact performance. It could also lead to unexpected behavior if the opening and closing of the cursor are not defined in the same loop.
== Noncompliant Code Example
----
PERFORM UNTIL (NOT DA-OK) OR (Y00CIA-CD-RET-PGM = ZERO)
EXEC SQL DECLARE C2 CURSOR FOR
SELECT DEPTNO, DEPTNAME, MGRNO FROM DEPARTMENT WHERE ADMRDEPT = 'A00'
END-EXEC
END-PERFORM.
----