Home

Scale should not be specified for float types

Rule description

  • Scale should not be specified for float types

 

Non-compliant Code Example

Create TABLE VENDOR
(
  ID number(10) NOT NULL,
  NAME NVARCHAR2(75),
  ADDRESS NVARCHAR2,
  Landmark VARCHAR2,
  TurnOver FLOAT(12,2),             --Non compliant code (Scale specified in the float types)
  CONSTRAINT pk_vendor PRIMARY KEY (ID)
);

Compliant Code Example

Create TABLE VENDOR
(
  ID number(10) NOT NULL,
  NAME NVARCHAR2(75),
  ADDRESS NVARCHAR2,
  Landmark VARCHAR2,
  TurnOver FLOAT(12),             --Compliant code
  CONSTRAINT pk_vendor PRIMARY KEY (ID)
);
Visual Expert 2020
 VEPLSQLRULE12