CREATE TABLE CONFIGALCADA (
  NRCONFIGALCADA NUMBER(10) NOT NULL, 
  NMALCADA VARCHAR2(30) NOT NULL, 
  DTULTATUALC DATE NOT NULL, 
  IDLANCAFEXTRA VARCHAR2(30) DEFAULT 'AMBOS' NOT NULL, 
  IDLANCSCEXTRA VARCHAR2(30) DEFAULT 'AMBOS' NOT NULL, 
  IDTIPOAF VARCHAR2(30) DEFAULT 'AMBOS' NOT NULL, 
  IDTIPOSC VARCHAR2(30) DEFAULT 'AMBOS' NOT NULL, 
  IDTPLANC VARCHAR2(30) DEFAULT 'AMBOS' NOT NULL, 
  IDCANCEL VARCHAR2(1) DEFAULT 'N' NULL, 
  IDBAIXMANUAL VARCHAR2(1) DEFAULT 'N' NULL, 
  IDFORAORC VARCHAR2(1) DEFAULT 'N' NULL, 
  IDEXCLUSAO VARCHAR2(1) DEFAULT 'N' NULL, 
  IDIMPGESTFIL VARCHAR2(1) DEFAULT 'N' NULL, 
  VRPLANEJAMENTO DOUBLE PRECISION DEFAULT NULL NULL, 
  VRSUPERVISOR DOUBLE PRECISION DEFAULT NULL NULL, 
  VRGERREGIONAL DOUBLE PRECISION DEFAULT NULL NULL, 
  VRDIRETORIA DOUBLE PRECISION DEFAULT NULL NULL, 
  NRORG NUMBER(10) DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 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, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT '1' NULL,
  CONSTRAINT PK_CONFIGALCADA PRIMARY KEY(NRCONFIGALCADA)
)
/
ALTER TABLE CONFIGALCADA ADD CONSTRAINT CKC_IDLANCAFEXTRA CHECK (IDLANCAFEXTRA IN ('S', 'N', 'AMBOS'))
/
ALTER TABLE CONFIGALCADA ADD CONSTRAINT CKC_IDLANCSCEXTRA CHECK (IDLANCSCEXTRA IN ('S', 'N', 'AMBOS'))
/
ALTER TABLE CONFIGALCADA ADD CONSTRAINT CKC_IDTIPOAF CHECK (IDTIPOAF IN ('M', 'A', 'AMBOS'))
/
ALTER TABLE CONFIGALCADA ADD CONSTRAINT CKC_IDTIPOSC CHECK (IDTIPOSC IN ('M', 'A', 'AMBOS'))
/
ALTER TABLE CONFIGALCADA ADD CONSTRAINT CKC_IDTPLANC CHECK (IDTPLANC IN ('UNIDADE', 'MATRIZ', 'AMBOS'))
/
ALTER TABLE CONFIGALCADA ADD CONSTRAINT CKC_IDCANCEL CHECK (IDCANCEL IS NULL OR (IDCANCEL IN ('S', 'N')))
/
ALTER TABLE CONFIGALCADA ADD CONSTRAINT CKC_IDBAIXMANUAL CHECK (IDBAIXMANUAL IS NULL OR (IDBAIXMANUAL IN ('S', 'N')))
/
ALTER TABLE CONFIGALCADA ADD CONSTRAINT CKC_IDFORAORC CHECK (IDFORAORC IS NULL OR (IDFORAORC IN ('S', 'N')))
/
ALTER TABLE CONFIGALCADA ADD CONSTRAINT CKC_IDEXCLUSAO CHECK (IDEXCLUSAO IS NULL OR (IDEXCLUSAO IN ('S', 'N')))
/
ALTER TABLE CONFIGALCADA ADD CONSTRAINT CKC_IDIMPGESTFIL CHECK (IDIMPGESTFIL IS NULL OR (IDIMPGESTFIL IN ('S', 'N')))
/
ALTER TABLE CONFIGALCADA ADD CONSTRAINT CKC_IDATIVO_CONFIGALCADA CHECK (IDATIVO IN ('S', 'N'))