ALTER TABLE invitm ADD PALETE_SEQ BIGINT;
ALTER TABLE invitm add UMVCAD_ID BIGINT;

alter TABLE INVITM modify( 
    INVITM_SALDOERP      	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_SALDOWMS      	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_STATUS        	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_QDE1ACONT     	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_QDERETRY1ACONT	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_QDEERRO1ACONT 	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_QDE2ACONT     	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_QDERETRY2ACONT	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_QDEERRO2ACONT 	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_QDE3ACONT     	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_QDERETRY3ACONT	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_QDEERRO3ACONT 	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_QDE4ACONT     	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_QDERETRY4ACONT	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_QDEERRO4ACONT 	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_SALDOINV      	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_AJUSTEERP     	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_AJUSTEWMS     	DEFAULT 0
)
alter TABLE INVITM modify(
    INVITM_TICKET        	DEFAULT 0
)
alter TABLE INVITM modify(
    DOCCAB_SEQ           	DEFAULT 0
)
alter TABLE INVITM modify(
    DOCITM_SEQ           	DEFAULT 0
)
alter TABLE INVITM modify(
    PALETE_SEQ           	DEFAULT 0
)
alter TABLE INVITM modify(
    UMVCAD_ID            	DEFAULT 0
)

ALTER TABLE invitm ADD INVITM_AJUSTEERPVALOR decimal (11,4) NULL;
ALTER TABLE invitm ADD INVITM_AJUSTEWMSVALOR decimal (11,4) NULL;
ALTER TABLE invitm ADD INVITM_SEQITEM NUMBER(12,0) NULL;


--- sql sERVER

ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_SALDOERP
  DEFAULT 0 FOR INVITM_SALDOERP;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_SALDOWMS
  DEFAULT 0 FOR INVITM_SALDOWMS;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_STATUS
  DEFAULT 0 FOR INVITM_STATUS;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_QDE1ACONT
  DEFAULT 0 FOR INVITM_QDE1ACONT;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_QDE2ACONT
  DEFAULT 0 FOR INVITM_QDE2ACONT;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_QDE3ACONT
  DEFAULT 0 FOR INVITM_QDE3ACONT;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_QDE4ACONT
  DEFAULT 0 FOR INVITM_QDE4ACONT;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_QDERETRY1ACONT
  DEFAULT 0 FOR INVITM_QDERETRY1ACONT;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_QDERETRY2ACONT
  DEFAULT 0 FOR INVITM_QDERETRY2ACONT;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_QDERETRY3ACONT
  DEFAULT 0 FOR INVITM_QDERETRY3ACONT;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_QDERETRY4ACONT
  DEFAULT 0 FOR INVITM_QDERETRY4ACONT;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_QDEERRO1ACONT
  DEFAULT 0 FOR INVITM_QDEERRO1ACONT;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_QDEERRO2ACONT
  DEFAULT 0 FOR INVITM_QDEERRO2ACONT;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_QDEERRO3ACONT
  DEFAULT 0 FOR INVITM_QDEERRO3ACONT;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_QDEERRO4ACONT
  DEFAULT 0 FOR INVITM_QDEERRO4ACONT;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_SALDOINV
  DEFAULT 0 FOR INVITM_SALDOINV;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_AJUSTEERP
  DEFAULT 0 FOR INVITM_AJUSTEERP;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_AJUSTEWMS
  DEFAULT 0 FOR INVITM_AJUSTEWMS;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_INVITM_TICKET
  DEFAULT 0 FOR INVITM_TICKET;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_DOCCAB_SEQ
  DEFAULT 0 FOR DOCCAB_SEQ;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_DOCITM_SEQ
  DEFAULT 0 FOR DOCITM_SEQ;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_PALETE_SEQ
  DEFAULT 0 FOR PALETE_SEQ;
ALTER TABLE invitm
  ADD CONSTRAINT DF_INVITM_UMVCAD_ID
  DEFAULT 0 FOR UMVCAD_ID;
  
  
  CREATE INDEX index1
  ON invitm (
    doccab_seq,
    empres_codigo,
    filial_codigo,
    depart_codigo,
    deposi_codigo,
    setor_codigo,
    corred_codigo,
    invitm_status
  );