Home

END LOOP should be followed by a semicolon

Rule description

  • END LOOP should be followed by a semicolon

 

Non-compliant Code Example

BEGIN
	FOR i IN 1 .. CUSTOMER_TABLE.COUNT
	   LOOP
			IF CUSTOMER_TABLE(i) IS NOT NULL THEN
				DBMS_OUTPUT.PUT( i || ' = (' || CUSTOMER_TABLE(i).Name || ', ' || CUSTOMER_TABLE(i).PhoneNumber || ')' );
			ELSE
				DBMS_OUTPUT.PUT( i || ' IS NULL' );
			END IF;
		END LOOP            --Non compliant code (Loop ends without semicolon)
	COMMIT;
END;

Compliant Code Example

BEGIN
	FOR i IN 1 .. CUSTOMER_TABLE.COUNT
	   LOOP
			IF CUSTOMER_TABLE(i) IS NOT NULL THEN
				DBMS_OUTPUT.PUT( i || ' = (' || CUSTOMER_TABLE(i).Name || ', ' || CUSTOMER_TABLE(i).PhoneNumber || ')' );
			ELSE
				DBMS_OUTPUT.PUT( i || ' IS NULL' );
			END IF;
		END LOOP;       --Compliant code (Loop ends with semicolon)
	COMMIT;
END;
Visual Expert 2020
 VEPLSQLRULE9