Home

Constraint names should comply with a naming convention

Rule description

  • Constraint names should comply with a naming convention

 

Non-compliant Code Example

Create TABLE EMPLOYEE 
(
  EMP_ID number(10) NOT NULL,
  FIRSTNAME NVARCHAR2(75),
  LASTNAME NVARCHAR2(75),
  DEPT_ID int,  
  ADDRESS NVARCHAR2(250) NOT NULL,

  CONSTRAINT employee_pk PRIMARY KEY (EMP_ID) --Non compliant code
);

Compliant Code Example

Create TABLE EMPLOYEE 
(
  EMP_ID number(10) NOT NULL,
  FIRSTNAME NVARCHAR2(75),
  LASTNAME NVARCHAR2(75),
  DEPT_ID int,  
  ADDRESS NVARCHAR2(250) NOT NULL,

  CONSTRAINT pk_employee PRIMARY KEY (EMP_ID)   --Compliant code
);
Visual Expert 2020
 VEPLSQLRULE183