Home
Unused labels should be removed
Rule description
- Unused labels should be removed
Non-compliant Code Example
DECLARE
id customers.id%type;
name customer.name%type;
address customers.address%type;
CURSOR customers_c is
SELECT id, name, address FROM customers;
BEGIN
OPEN customers_c;
<<INNER_LOOP>> --Non compliant code (Unused labels)
LOOP
FETCH customers_c into id, name, address;
EXIT WHEN customers_c%notfound;
dbms_output.put_line(id || ' ' || name || ' ' || address);
END LOOP INNERONE_LOOP;
CLOSE customers_c;
END;
Compliant Code Example
DECLARE
id customers.id%type;
name customer.name%type;
address customers.address%type;
CURSOR customers_c is
SELECT id, name, address FROM customers;
BEGIN
OPEN customers_c;
LOOP --Compliant code (Unused labels removed)
FETCH customers_c into id, name, address;
EXIT WHEN customers_c%notfound;
dbms_output.put_line(id || ' ' || name || ' ' || address);
END LOOP;
CLOSE customers_c;
END;