CREATE TABLE AUXSUBGRUPRINCMENU (
  CDFILIAL VARCHAR2(4) NOT NULL, 
  CDCIA VARCHAR2(4) NOT NULL, 
  CDMANCIA VARCHAR2(4) NOT NULL, 
  NRSERVICOCIAFILI NUMBER(10) NOT NULL, 
  CDCLASSE VARCHAR2(4) NOT NULL, 
  CDSUBGRU VARCHAR2(10) NOT NULL, 
  NRSEQSUBGRUSEMAM NUMBER(10) NOT NULL, 
  CDCICLO VARCHAR2(4) NOT NULL, 
  CDSUBGRUPRIN VARCHAR2(10) NOT NULL, 
  NRSEQSUBGRUSEMAMPRIN NUMBER(10) NOT NULL, 
  NRORG NUMBER(10) DEFAULT 1 NOT NULL, 
  IDATIVO VARCHAR2(1) DEFAULT 'S' NOT NULL, 
  DTINCLUSAO DATE DEFAULT NULL NULL, 
  DTULTATU DATE DEFAULT NULL NULL, 
  NRORGINCLUSAO NUMBER(10) DEFAULT 1 NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT '1' NULL,
  CONSTRAINT PK_AUXSUBGRUPRINCMENU PRIMARY KEY(CDFILIAL, CDCIA, CDMANCIA, NRSERVICOCIAFILI, CDCLASSE, CDSUBGRU, NRSEQSUBGRUSEMAM, CDSUBGRUPRIN, NRSEQSUBGRUSEMAMPRIN, CDCICLO, NRORG)
)
/
ALTER TABLE AUXSUBGRUPRINCMENU ADD CONSTRAINT CKC_IDATIVO_AUXSUBPRI CHECK (IDATIVO IN ('S','N'))