ALTER TABLE ITEMSOLI ADD (
  DTENTRCONSOL DATE DEFAULT NULL NULL
)
/
CREATE TABLE LOGITEMSOLICONS (
  NRLOGITEMSOLICONS NUMBER(10) NOT NULL, 
  NRSEQUCONSOL VARCHAR2(10) NOT NULL, 
  CDFILIOPELOG VARCHAR2(4) NOT NULL, 
  CDFILSOLI VARCHAR2(4) NOT NULL, 
  CDFILLAN VARCHAR2(4) NOT NULL, 
  CDPRODUTO VARCHAR2(10) NOT NULL, 
  DTPROGENTR DATE NOT NULL, 
  QTSOLIPROD DOUBLE PRECISION NOT NULL, 
  DTENTRCONSOL DATE DEFAULT NULL 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_LOGITEMSOLICONS PRIMARY KEY(NRLOGITEMSOLICONS, NRORG)
)
/
ALTER TABLE LOGITEMSOLICONS ADD CONSTRAINT FKSUP00665CONSSOLOL FOREIGN KEY (NRSEQUCONSOL, NRORG) REFERENCES CONSSOLOL (NRSEQUCONSOL, NRORG) ON DELETE CASCADE
/
ALTER TABLE LOGITEMSOLICONS ADD CONSTRAINT CKC_IDATIVO_LOGITEMSOLICONS CHECK (IDATIVO IN ('S','N'))
/
CREATE INDEX FKSUP00665CONSSOLOL ON LOGITEMSOLICONS (NRSEQUCONSOL, NRORG)