CREATE TABLE LOGITMAPURPREC (
  NRLOGITMAPURPREC NUMBER(10) NOT NULL, 
  CDCENTITMAP VARCHAR2(4) NOT NULL, 
  NRSEQITMAP VARCHAR2(10) NOT NULL, 
  CDREGITMAP VARCHAR2(3) NOT NULL, 
  CDFORNITMAP VARCHAR2(21) NOT NULL, 
  NRCOLEITMAP VARCHAR2(10) NOT NULL, 
  DTENTRAPUT DATE NOT NULL, 
  CDFILIAP VARCHAR2(4) NOT NULL, 
  CDPRODITMAP VARCHAR2(10) NOT NULL, 
  CDMARCITMAP VARCHAR2(5) NOT NULL, 
  QTSOLACOMP DOUBLE PRECISION DEFAULT NULL NULL, 
  QTACOMP DOUBLE PRECISION DEFAULT NULL NULL, 
  DTOPERACAO DATE DEFAULT NULL NULL, 
  IDTIPOOPERACAO VARCHAR2(30) NOT NULL, 
  IDITMSELAPUR VARCHAR2(1) DEFAULT 'N' 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, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT '1' NULL,
  CONSTRAINT PK_LOGITMAPURPREC PRIMARY KEY(NRLOGITMAPURPREC)
)
/
ALTER TABLE LOGITMAPURPREC ADD CONSTRAINT CKC_IDTIPOOPERACAO CHECK (IDTIPOOPERACAO IN ('INCLUSAO', 'ALTERACAO', 'EXCLUSAO'))
/
ALTER TABLE LOGITMAPURPREC ADD CONSTRAINT CKC_IDITMSELAPUR CHECK (IDITMSELAPUR IS NULL OR (IDITMSELAPUR IN ('S', 'N')))
/
ALTER TABLE LOGITMAPURPREC ADD CONSTRAINT CKC_IDATIVO_LOGITMAPURPREC CHECK (IDATIVO IN ('S', 'N'))