CREATE TABLE ETLALTERPRODSAP
(
  ANETLSAP        VARCHAR2(4),
  MEETLSAP        VARCHAR2(2),
  BIETLSAP        VARCHAR2(6),
  SEETLSAP        VARCHAR2(6),
  TRETLSAP        VARCHAR2(6),
  CDTPFATU        VARCHAR2(30),
  CDEMPRESA       VARCHAR2(2),
  CDAREAGERE      VARCHAR2(3),
  CDGOPERAC       VARCHAR2(12),
  CDSEGMER        VARCHAR2(5),
  CDFILIAL        VARCHAR2(4),
  CDFILIPROC      VARCHAR2(4),
  CDOPERADOR      VARCHAR2(12),
  CDPRODUTO       VARCHAR2(10),
  QTDANTOPER      FLOAT(126),
  QTDDEPOPER      FLOAT(126),
  QTDTOTALTER     FLOAT(126)
)
/
ALTER TABLE ETLALTERPRODSAP ADD CDANOBI VARCHAR2(4) NULL
/
ALTER TABLE ETLALTERPRODSAP ADD CDMESBI VARCHAR2(2) NULL
/
ALTER TABLE ETLALTERPRODSAP ADD DSDTALTERPROD VARCHAR2(20) NULL
/
CREATE INDEX GSC00313_FK ON ETLALTERPRODSAP (CDANOBI ASC)
/
CREATE INDEX GSC00314_FK ON ETLALTERPRODSAP (CDMESBI ASC)
/
ALTER TABLE ETLALTERPRODSAP
    ADD CONSTRAINT FKGSC00513ETLANOBI FOREIGN KEY  (CDANOBI)
       REFERENCES ETLANOBI (CDANOBI)
/
ALTER TABLE ETLALTERPRODSAP
    ADD CONSTRAINT FKGSC00514ETLMESBI FOREIGN KEY  (CDMESBI)
       REFERENCES ETLMESBI (CDMESBI)
/
CREATE TABLE ETLALTPRODDRILL
(
  ANETLSAP        VARCHAR2(4),
  MEETLSAP        VARCHAR2(2),
  BIETLSAP        VARCHAR2(6),
  SEETLSAP        VARCHAR2(6),
  TRETLSAP        VARCHAR2(6),
  CDANOBI         VARCHAR2(4),
  CDMESBI         VARCHAR2(2),
  DSDTALTERPROD   VARCHAR2(20),
  NRSOLIMOV       VARCHAR2(10),
  CDTPFATU        VARCHAR2(30),
  CDEMPRESA       VARCHAR2(2),
  CDAREAGERE      VARCHAR2(3),
  CDGOPERAC       VARCHAR2(12),
  CDSEGMER        VARCHAR2(5),
  CDFILIAL        VARCHAR2(4),
  CDFILIPROC      VARCHAR2(4),
  CDOPERADOR      VARCHAR2(12),
  CDPRODUTO       VARCHAR2(10),
  QTDANTOPER      FLOAT(126),
  QTDDEPOPER      FLOAT(126),
  QTDTOTALTER     FLOAT(126)
)
/
CREATE INDEX GSC01313_FK ON ETLALTPRODDRILL (CDANOBI ASC)
/
CREATE INDEX GSC01314_FK ON ETLALTPRODDRILL (CDMESBI ASC)
/
ALTER TABLE ETLALTPRODDRILL
    ADD CONSTRAINT FKGSC01313ETLANOBI FOREIGN KEY  (CDANOBI)
       REFERENCES ETLANOBI (CDANOBI)
/
ALTER TABLE ETLALTPRODDRILL
    ADD CONSTRAINT FKGSC01314ETLMESBI FOREIGN KEY  (CDMESBI)
       REFERENCES ETLMESBI (CDMESBI)
/
BEGIN
   INSERT INTO OPERADOR (CDOPERADOR, NMOPERADOR, IDOPERATIVO)
   VALUES ('XXXXXXXXXXXX', 'VIA BD', 'I');
   COMMIT;
EXCEPTION
   WHEN OTHERS THEN NULL;
END;
/

BEGIN ATUVEROBJ('ATUALIZACAO_ESTRUTURA_BD','5.05.111'); END;
/