ALTER TABLE ESO_ENVIOCADASTROS ADD VRBASEMENSAL FLOAT
/

ALTER TABLE ESO_ENVIOCADASTROS ADD VRBASE13 FLOAT
/

ALTER TABLE ESO_ENVIOCADASTROS ADD VRVALORMENSAL FLOAT
/

ALTER TABLE ESO_ENVIOCADASTROS ADD VRVALOR13 FLOAT
/

ALTER TABLE ESO_ENVIOCADASTROS ADD VRVALORMATERMENSAL FLOAT
/

ALTER TABLE ESO_ENVIOCADASTROS ADD VRVALORMATER13 FLOAT
/

ALTER TABLE ESO_ENVIOCADASTROS ADD VRSALFAMILIA FLOAT
/

ALTER TABLE ESO_ENVIOCADASTROS ADD VRSALFAMILIA13 FLOAT
/

ALTER TABLE ESO_ENVIOCADASTROS ADD VRCALCULADO FLOAT
/

ALTER TABLE ESO_ENVIOCADASTROS ADD VRDESCONTADO FLOAT
/

ALTER TABLE ESO_ENVIOCADASTROS ADD NRESTRUTLOTACAO NUMBER
/

ALTER TABLE ESO_ENVIOCADASTROS
    ADD CONSTRAINT FKESO_ENVIOLOTACAO FOREIGN KEY  (NRESTRUTLOTACAO)
       REFERENCES ESTRUTURAM (NRESTRUTURAM)
/


ALTER TABLE INTG_TRABITPROIMPOS ADD NRORG NUMBER DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL
/

ALTER TABLE INTG_TRABITPROIMPOS ADD IDATIVO VARCHAR2(1)  DEFAULT 'S' NOT NULL
    CONSTRAINT CKC_IDATIVO_INTGTRITPRIMP  CHECK (IDATIVO IN ('S','N'))
/

ALTER TABLE INTG_TRABITPROIMPOS ADD DTINCLUSAO DATE NULL
/

ALTER TABLE INTG_TRABITPROIMPOS ADD CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL
/

ALTER TABLE INTG_TRABITPROIMPOS ADD DTULTATU DATE NULL
/

ALTER TABLE INTG_TRABITPROIMPOS ADD NRORGINCLUSAO NUMBER DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')  NULL
/

ALTER TABLE INTG_TRABITPROIMPOS ADD NRORGULTATU NUMBER DEFAULT  SYS_CONTEXT('nrorg_ctx','nrorg') NULL
/

ALTER TABLE INTG_TRABITPROIMPOS ADD CDOPERULTATU VARCHAR2(12) DEFAULT '1' NULL
/

ALTER TABLE  INTG_ITEMPRODUTO ADD NRORG  NUMBER DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL
/

ALTER TABLE  INTG_ITEMPRODUTO ADD IDATIVO  VARCHAR2(1)  DEFAULT 'S' NOT NULL
    CONSTRAINT CKC_IDATIVO_INTGITEMPROD CHECK (IDATIVO IN ('S','N'))
/

ALTER TABLE  INTG_ITEMPRODUTO ADD DTINCLUSAO  DATE  NULL
/

ALTER TABLE  INTG_ITEMPRODUTO ADD CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL
/

ALTER TABLE  INTG_ITEMPRODUTO ADD  DTULTATU DATE  NULL
/

ALTER TABLE  INTG_ITEMPRODUTO ADD  NRORGINCLUSAO NUMBER DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')  NULL
/

ALTER TABLE  INTG_ITEMPRODUTO ADD NRORGULTATU NUMBER DEFAULT  SYS_CONTEXT('nrorg_ctx','nrorg') NULL
/

ALTER TABLE  INTG_ITEMPRODUTO ADD CDOPERULTATU  VARCHAR2(12) DEFAULT '1' NULL
/

ALTER TABLE DADOSFORNECOMMERCE ADD CDECOOPER VARCHAR2(12) NULL  
/

CREATE TABLE DM_RESULT_OPERACIONAL (
      DTRESUMO            DATE             NULL,
      CDEMPRESA           VARCHAR2(02)     NULL,
      NMEMPRESA           VARCHAR2(40)     NULL,
      CDREGIONAL          VARCHAR2(03)     NULL,
      NMREGIONAL          VARCHAR2(30)     NULL,
      CDSEGMERCADO        VARCHAR2(05)     NULL,
      NMSEGMERCADO        VARCHAR2(40)     NULL,
      CDSUPERVISOR        VARCHAR2(12)     NULL,
      NMSUPERVISOR        VARCHAR2(40)     NULL,
      CDFILIAL            VARCHAR2(04)     NULL,
      NMFILIAL            VARCHAR2(30)     NULL,
      CDFILIALCENT        VARCHAR2(04)     NULL,
      NMFILIALCENT        VARCHAR2(30)     NULL,
      CDPAIS              VARCHAR2(04)     NULL,
      NMPAIS              VARCHAR2(30)     NULL,
      SGESTADO            VARCHAR2(02)     NULL,
      NMESTADO            VARCHAR2(30)     NULL,
      CDMUNICIPIO         VARCHAR2(04)     NULL,
      NMMUNICIPIO         VARCHAR2(30)     NULL,
      IDTPLANCROP         VARCHAR2(30)     NULL,
      CDGRUPPROD          VARCHAR2(10)     NULL,
      NMGRUPPROD          VARCHAR2(40)     NULL,
      CDSUBGRUPPROD       VARCHAR2(10)     NULL,
      NMSUBGRUPPROD       VARCHAR2(40)     NULL,
      CDSERVICO           VARCHAR2(05)     NULL,
      NMSERVICO           VARCHAR2(40)     NULL,
      CDGRUPSERV          VARchAR2(03)     NULL,
      NMGRUPSERV          VARCHAR2(30)     NULL,
      QTSERVICO           FLOAT            NULL,
      CDTIPOOPER          VARCHAR2(02)     NULL,
      NMTIPOOPER          VARCHAR2(30)     NULL,
      IDENTRSAIDOP        VARCHAR2(01)     NULL,
      NRINSJURCLIE        VARCHAR2(21)     NULL,
      NMCLIENTE           VARCHAR2(100)    NULL,
      CDRECEXTRA          VARCHAR2(04)     NULL,
      NMRECEXTRA          VARCHAR2(200)    NULL,
      CDFATUDIVER         VARCHAR2(02)     NULL,
      NMFATUDIVER         VARCHAR2(40)     NULL,
      CDIMPOSTO           VARCHAR2(02)     NULL,
      NMIMPOSTO           VARCHAR2(30)     NULL,
      CDENCARGO           VARCHAR2(02)     NULL,
      NMENCARGO           VARCHAR2(20)     NULL,
      NRINSJURFORN        VARCHAR2(21)     NULL,
      NMFORNECED          VARCHAR2(40)     NULL,
      CDDESPPREV          VARCHAR2(03)     NULL,
      NMDESPPREV          VARCHAR2(50)     NULL,
      CDTPCTPAGAR         VARCHAR2(06)     NULL,
      NMTPCTPAGAR         VARCHAR2(40)     NULL,
      CDTPCTRECEBER       VARCHAR2(06)     NULL,
      NMTPCTRECEBER       VARCHAR2(40)     NULL,
      CDAJUCTPAG          VARCHAR2(04)     NULL,
      DSAJUCTPAG          VARCHAR2(40)     NULL,
      CDAJUCTREC          VARCHAR2(04)     NULL,
      DSAJUCTREC          VARCHAR2(40)     NULL,
      CDARVPROD           VARCHAR2(20)     NULL,
      NMPRODUTO           VARCHAR2(50)     NULL,
      CDDESPADMFAT        VARCHAR2(02)     NULL,
      NMDESPADMFAT        VARCHAR2(40)     NULL,
      CDINVESTIMENTO      VARCHAR2(10)     NULL,
      NMINVESTIMENTO      VARCHAR2(50)     NULL,
      VRFATBRUTO          FLOAT            NULL,
      VRFATBRUTOPROJ      FLOAT            NULL,
      VRFATBRUTOORCA      FLOAT            NULL,
      VRFATURNF           FLOAT            NULL,
      VRFATURNFPROJ       FLOAT            NULL,
      VRFATURNFORCA       FLOAT            NULL,
      VRFATUREFET         FLOAT            NULL,
      VRFATUREFETPROJ     FLOAT            NULL,
      VRFATUREFETORCA     FLOAT            NULL,
      VRFATURFOSCONT      FLOAT            NULL,
      VRFATURFOSBRUT      FLOAT            NULL,
      VRFATURFOSBRUTPROJ  FLOAT            NULL,
      VRFATURFOSBRUTORCA  FLOAT            NULL,
      VRFATURFOSCANC      FLOAT            NULL,
      VRFATURFOSDESC      FLOAT            NULL,
      VRFATURFOSDESCPROJ  FLOAT            NULL,
      VRFATURFOSDESCORCA  FLOAT            NULL,
      VRFATURDIV          FLOAT            NULL,
      VRFATURDIVPROJ      FLOAT            NULL,
      VRFATURDIVORCA      FLOAT            NULL,
      VRFATRECEXTRA       FLOAT            NULL,
      VRFATRECEXTRAPROJ   FLOAT            NULL,
      VRFATRECEXTRAORCA   FLOAT            NULL,
      VRDEDURECEITA       FLOAT            NULL,
      VRDEDURECEITAPROJ   FLOAT            NULL,
      VRDEDURECEITAORCA   FLOAT            NULL,
      VRIMPOSTO           FLOAT            NULL,
      VRIMPOSTOPROJ       FLOAT            NULL,
      VRIMPOSTOORCA       FLOAT            NULL,
      VRCREDIMPOSTO       FLOAT            NULL,
      VRCREDIMPOSTOPROJ   FLOAT            NULL,
      VRCREDIMPOSTOORCA   FLOAT            NULL,
      VRDEVOLUESTOR       FLOAT            NULL,
      VRDEVOLUESTORPROJ   FLOAT            NULL,
      VRDEVOLUESTORORCA   FLOAT            NULL,
      VRDEDUSOBVENDA      FLOAT            NULL,
      VRDEDUSOBVENDAPROJ  FLOAT            NULL,
      VRDEDUSOBVENDAORCA  FLOAT            NULL,
      VRENCARGO           FLOAT            NULL,
      VRENCARGOPROJ       FLOAT            NULL,
      VRENCARGOORCA       FLOAT            NULL,
      VRFATLIQUIDO        FLOAT            NULL,
      VRFATLIQUIDOPROJ    FLOAT            NULL,
      VRFATLIQUIDOORCA    FLOAT            NULL,
      VRTAXAADM           FLOAT            NULL,
      VRTAXAADMPROJ       FLOAT            NULL,
      VRTAXAADMORCA       FLOAT            NULL,
      VRMARGEMCONTR       FLOAT            NULL,
      VRMARGEMCONTRPROJ   FLOAT            NULL,
      VRMARGEMCONTRORCA   FLOAT            NULL,
      VRDESPESATOT        FLOAT            NULL,
      VRDESPESATOTPROJ    FLOAT            NULL,
      VRDESPESATOTORCA    FLOAT            NULL,
      VRDESPESA           FLOAT            NULL,
      VRDESPESAPROJ       FLOAT            NULL,
      VRDESPESAORCA       FLOAT            NULL,
      VRAJUSTE            FLOAT            NULL,
      VRAJUSTEPROJ        FLOAT            NULL,
      VRAJUSTEORCA        FLOAT            NULL,
      VRDEBITOBCO         FLOAT            NULL,
      VRDEBITOBCOPROJ     FLOAT            NULL,
      VRDEBITOBCOORCA     FLOAT            NULL,
      VRCREDITOBCO        FLOAT            NULL,
      VRCREDITOBCOPROJ    FLOAT            NULL,
      VRCREDITOBCOORCA    FLOAT            NULL,
      VRMAOOBRA           FLOAT            NULL,
      VRMAOOBRAPROJ       FLOAT            NULL,
      VRMAOOBRAORCA       FLOAT            NULL,
      VRRESULTPARC        FLOAT            NULL,
      VRRESULTPARCPROJ    FLOAT            NULL,
      VRRESULTPARCORCA    FLOAT            NULL,
      VRDEPRECIACAO       FLOAT            NULL,
      VRDEPRECIACAOPROJ   FLOAT            NULL,
      VRDEPRECIACAOORCA   FLOAT            NULL,
      VRINVESTIMENTO      FLOAT            NULL,
      VRINVESTIMENTOPROJ  FLOAT            NULL,
      VRINVESTIMENTOORCA  FLOAT            NULL,
      VRRESULTFINAL       FLOAT            NULL,
      VRRESULTFINALPROJ   FLOAT            NULL,
      VRRESULTFINALORCA   FLOAT            NULL,
      VRESTOQINICIAL      FLOAT            NULL,
      VRIMPLANTAEST       FLOAT            NULL,
      VRENTRCOMPRAS       FLOAT            NULL,
      VROUTRASENTR        FLOAT            NULL,
      VRCONHECTRANS       FLOAT            NULL,
      VRAJUSTEEST         FLOAT            NULL,
      VRSAIDDEVOLU        FLOAT            NULL,
      VROUTRASSAID        FLOAT            NULL,
      VRRETIRAAJUST       FLOAT            NULL,
      VRESTOQFINAL        FLOAT            NULL,
      VRCMV               FLOAT            NULL,
      VRCONSUMO           FLOAT            NULL,
      VRCONSUMOPROJ       FLOAT            NULL,
      VRCONSUMOORCA       FLOAT            NULL,
      VRDIFCMVCONS        FLOAT            NULL,
   NRORG                       NUMBER DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
   IDATIVO                    VARCHAR2(1)     DEFAULT 'S' NOT NULL
      CONSTRAINT CKC_IDATIVO_DMRESOPERACI CHECK (IDATIVO IN ('S','N')),
   DTINCLUSAO             DATE                   NULL,
   DTULTATU                  DATE                  NULL,
   NRORGINCLUSAO      NUMBER DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')  NULL,
   CDOPERINCLUSAO    VARCHAR2(12)  DEFAULT '1' NULL,
   NRORGULTATU          NUMBER DEFAULT  SYS_CONTEXT('nrorg_ctx','nrorg') NULL,
   CDOPERULTATU        VARCHAR2(12)  DEFAULT '1'
)
/

CREATE INDEX DM_RESULT_OPERACIONAL_01 ON DM_RESULT_OPERACIONAL (DTRESUMO ASC, CDEMPRESA ASC, CDREGIONAL ASC, CDSEGMERCADO ASC, CDSUPERVISOR ASC, CDFILIAL ASC)
/

CREATE INDEX DM_RESULT_OPERACIONAL_02 ON DM_RESULT_OPERACIONAL (DTRESUMO ASC, CDFILIAL ASC)
/

ALTER TABLE PERCITEMDETALGOP ADD CDORCAMENTOMO VARCHAR2(10)
/

ALTER TABLE PERCITDETALFILGOP ADD CDORCAMENTOMO VARCHAR2(10)