Code Analysis: Rule 2831 & 4404

Suggestion for another improvement of Code Analysis rules.

  • 2831: PLS_INTEGER cannot be used as type for a member - also applies to table columns: CREATE TABLE test_table( col NUMBER(1) );
  • 4404: END of a TYPE BODY cannot be labelled
    CREATE OR REPLACE TYPE test_type AS OBJECT (
    value NUMBER(1), – Rule 2831: Use PLS_INTEGER instead of INTEGER or equivalent subtypes.
    CONSTRUCTOR FUNCTION test_type RETURN SELF AS RESULT
    );

CREATE OR REPLACE TYPE BODY test_type AS
CONSTRUCTOR FUNCTION test_type RETURN SELF AS RESULT AS BEGIN
RETURN;
END test_type;
END; – Rule 4404: Avoid unlabeled END of program units, packages or types.

Thank you Peter. These look very meaningful.

Andre

Hi Peter,

2831: PLS_INTEGER cannot be used as type for a member <

We changed the parser to flag this as a syntax error.

Showing up in QP5 component 5.306.

Thanks,
Andre
(QP-1675)