/*==============================================================*/
/* DBMS name:      ORACLE Version 9i                            */
/* Created on:     29/01/2008 04:55:37 p.m.                     */
/*==============================================================*/


/*==============================================================*/
/* Table: ACT_ACTIVO                                            */
/*==============================================================*/
CREATE TABLE ACT_ACTIVO  (
   COD_CIA              CHAR(3)                         NOT NULL,
   COD_ACTIVO           VARCHAR2(10)                    NOT NULL,
   DES_ACTIVO           VARCHAR2(50)                    NOT NULL,
   COD_FAMILIA          VARCHAR2(10)                    NOT NULL,
   COD_LOCALIZA         VARCHAR2(10)                    NOT NULL,
   REFERENCIA           VARCHAR2(10),
   NUM_SERIE            VARCHAR2(25),
   NUM_MAQUINA          VARCHAR2(25),
   NUM_PLACA            VARCHAR2(25),
   NUM_MODELO           VARCHAR2(25),
   DES_MARCA            VARCHAR2(30),
   ENCARGADO            VARCHAR2(30)                    NOT NULL,
   FEC_COMPRA           DATE                            NOT NULL,
   DOC_REFEREN          VARCHAR2(10),
   VIDA_UTIL            NUMBER(7)                       NOT NULL
      CONSTRAINT ACT_ACTIVO_VIDA_UTIL_CK CHECK (VIDA_UTIL >= 0),
   COMENTARIO           VARCHAR2(80),
   MON_COMPRA           NUMBER(14,2)                    NOT NULL
      CONSTRAINT ACT_ACTIVO_MON_COMPRA_CK CHECK (MON_COMPRA >= 0),
   MON_REVALUADO        NUMBER(14,2)                    NOT NULL
      CONSTRAINT ACT_ACTIVO_MON_REVAL_CK CHECK (MON_REVALUADO >= 0),
   REV_DEDUCIBLE        NUMBER(14,2)                    NOT NULL
      CONSTRAINT ACT_ACTIVO_REV_DEDUCI_CK CHECK (REV_DEDUCIBLE >= 0),
   MON_RESCATE          NUMBER(14,2)                    NOT NULL
      CONSTRAINT ACT_ACTIVO_MON_RESCATE_CK CHECK (MON_RESCATE >= 0),
   TIPO_CAMBIO_HIST     NUMBER(7,2)                     NOT NULL
      CONSTRAINT ACT_ACTIVO_TIPO_CAMBIO_CK CHECK (TIPO_CAMBIO_HIST > 0),
   FEC_ULTDEP           DATE                            NOT NULL,
   FEC_INIDEP           DATE                            NOT NULL,
   MON_DEPACU_ORIG      NUMBER(14,2)                    NOT NULL
      CONSTRAINT ACT_ACTIVO_MON_DEPACU_ORIG_CK CHECK (MON_DEPACU_ORIG >= 0),
   MON_DEPACU_REV       NUMBER(14,2)                    NOT NULL
      CONSTRAINT ACT_ACTIVO_MON_DEPACU_REV_CK CHECK (MON_DEPACU_REV >= 0),
   FEC_ULTREV           DATE                            NOT NULL,
   FEC_RETIRO           DATE,
   EST_ACTIVO           CHAR(1)                         NOT NULL
      CONSTRAINT ACT_ACTIVO_EST_ACTIVO_CK CHECK (EST_ACTIVO IN ('P','N','R')),
   CONSTRAINT ACT_ACTIVO_PK PRIMARY KEY (COD_CIA, COD_ACTIVO)
)
INITRANS 1
STORAGE
(
    INITIAL 10K
    NEXT 10K
);

/*==============================================================*/
/* Index: ACTFAMILIA_ACTIVO_FK                                  */
/*==============================================================*/
CREATE INDEX ACTFAMILIA_ACTIVO_FK ON ACT_ACTIVO (
   COD_CIA ASC,
   COD_FAMILIA ASC
);

/*==============================================================*/
/* Index: ACTLOCALIZA_ACTIVO_FK                                 */
/*==============================================================*/
CREATE INDEX ACTLOCALIZA_ACTIVO_FK ON ACT_ACTIVO (
   COD_CIA ASC,
   COD_LOCALIZA ASC
);

/*==============================================================*/
/* Table: ACT_DETMOV                                            */
/*==============================================================*/
CREATE TABLE ACT_DETMOV  (
   COD_CIA              CHAR(3)                         NOT NULL,
   COD_MOV              CHAR(2)                         NOT NULL,
   CONSECUTIVO          NUMBER(10)                      NOT NULL,
   COD_ACTIVO           VARCHAR2(10)                    NOT NULL,
   MONTO                NUMBER(14,2)                    NOT NULL
      CONSTRAINT ACT_DETMOV_MONTO_CK CHECK (MONTO >= 0),
   DEP_REV              NUMBER(14,2)                   DEFAULT 0 NOT NULL
      CONSTRAINT ACT_DETMOV_DEP_REV_CK CHECK (DEP_REV >= 0),
   DEP_REVDED           NUMBER(14,2)                   DEFAULT 0 NOT NULL
      CONSTRAINT ACT_DETMOV_DEP_REVDED_CK CHECK (DEP_REVDED >= 0),
   DEP_MEJ              NUMBER(14,2)                   DEFAULT 0 NOT NULL
      CONSTRAINT ACT_DETMOV_DEP_MEJ_CK CHECK (DEP_MEJ >= 0),
   CANTIDAD             NUMBER(7)                      
      CONSTRAINT ACT_DETMOV_CANTIDAD_CK CHECK (CANTIDAD IS NULL OR (CANTIDAD >= 0 )),
   FEC_ULTDEP           DATE,
   FEC_ULTREV           DATE,
   CONSTRAINT ACT_DETMOV_PK PRIMARY KEY (COD_CIA, COD_MOV, CONSECUTIVO, COD_ACTIVO)
)
INITRANS 1
STORAGE
(
    INITIAL 10K
    NEXT 10K
);

/*==============================================================*/
/* Index: ACTACTIVO_DETMOV_FK                                   */
/*==============================================================*/
CREATE INDEX ACTACTIVO_DETMOV_FK ON ACT_DETMOV (
   COD_CIA ASC,
   COD_ACTIVO ASC
);

/*==============================================================*/
/* Table: ACT_DETTR                                             */
/*==============================================================*/
CREATE TABLE ACT_DETTR  (
   COD_CIA              CHAR(3)                         NOT NULL,
   COD_MOV              CHAR(2)                         NOT NULL,
   CONSECUTIVO          NUMBER(10)                      NOT NULL,
   COD_ACTIVO           VARCHAR2(10)                    NOT NULL,
   COD_LOCALIZA         VARCHAR2(10),
   COD_FAMILIA          VARCHAR2(10),
   CONSTRAINT ACT_DETTR_PK PRIMARY KEY (COD_CIA, COD_MOV, CONSECUTIVO, COD_ACTIVO)
);

/*==============================================================*/
/* Index: ACTACTIVO_DETTR_FK                                    */
/*==============================================================*/
CREATE INDEX ACTACTIVO_DETTR_FK ON ACT_DETTR (
   COD_CIA ASC,
   COD_ACTIVO ASC
);

/*==============================================================*/
/* Index: ACTLOCALIZA_DETTR_FK                                  */
/*==============================================================*/
CREATE INDEX ACTLOCALIZA_DETTR_FK ON ACT_DETTR (
   COD_CIA ASC,
   COD_LOCALIZA ASC
);

/*==============================================================*/
/* Index: ACTFAMILIA_DETTR_FK                                   */
/*==============================================================*/
CREATE INDEX ACTFAMILIA_DETTR_FK ON ACT_DETTR (
   COD_CIA ASC,
   COD_FAMILIA ASC
);

/*==============================================================*/
/* Table: ACT_ETIQ                                              */
/*==============================================================*/
CREATE TABLE ACT_ETIQ  (
   COD_CIA              CHAR(3)                         NOT NULL,
   SESION               NUMBER(5)                       NOT NULL,
   COD_ACTIVO           VARCHAR2(10)                    NOT NULL,
   CANTIDAD             NUMBER(3)                       NOT NULL,
   CONSTRAINT ACT_ETIQ_PK PRIMARY KEY (COD_CIA, SESION, COD_ACTIVO)
);

/*==============================================================*/
/* Table: ACT_FAMILIA                                           */
/*==============================================================*/
CREATE TABLE ACT_FAMILIA  (
   COD_CIA              CHAR(3)                         NOT NULL,
   COD_FAMILIA          VARCHAR2(10)                    NOT NULL,
   DES_FAMILIA          VARCHAR2(30)                    NOT NULL,
   PORC_REVALUACION     NUMBER(4,2)                     NOT NULL,
   COD_MONEDA           VARCHAR2(3)                     NOT NULL,
   COD_CTA              VARCHAR2(25),
   COD_CTA_DEPAC_ORIG   VARCHAR2(25),
   COD_CTA_DEPAC_REV    VARCHAR2(25),
   COD_CTA_REVAL        VARCHAR2(25),
   COD_CTA_SUPERAVIT    VARCHAR2(25),
   VIDA_UTIL            NUMBER(7)                       NOT NULL
      CONSTRAINT ACT_FAMILIA_VIDA_UTIL_CK CHECK (VIDA_UTIL > 0),
   TIP_REV              CHAR(1)                         NOT NULL
      CONSTRAINT ACT_FAMILIA_TIP_REV_CK CHECK (TIP_REV IN ('F','P','M','C','I')),
   TIP_DEP              CHAR(1)                         NOT NULL
      CONSTRAINT ACT_FAMILIA_TIP_DEP_CK CHECK (TIP_DEP IN ('L','D','C','A','M')),
   CONSTRAINT ACT_FAMILIA_PK PRIMARY KEY (COD_CIA, COD_FAMILIA)
)
INITRANS 1
STORAGE
(
    INITIAL 10K
    NEXT 10K
);

/*==============================================================*/
/* Table: ACT_HISDETMOV                                         */
/*==============================================================*/
CREATE TABLE ACT_HISDETMOV  (
   COD_CIA              CHAR(3)                         NOT NULL,
   COD_MOV              CHAR(2)                         NOT NULL,
   CONSECUTIVO          NUMBER(10)                      NOT NULL,
   COD_ACTIVO           VARCHAR2(10)                    NOT NULL,
   MONTO                NUMBER(14,2)                    NOT NULL
      CONSTRAINT ACT_HISDETMOV_MONTO_CK CHECK (MONTO >= 0),
   DEP_REV              NUMBER(14,2)                   DEFAULT 0 NOT NULL,
   DEP_REVDED           NUMBER(14,2)                   DEFAULT 0 NOT NULL,
   DEP_MEJ              NUMBER(14,2)                   DEFAULT 0 NOT NULL,
   CANTIDAD             NUMBER(7)                      
      CONSTRAINT ACT_HISDETMOV_CANTIDAD_CK CHECK (CANTIDAD IS NULL OR (CANTIDAD >=0 )),
   FEC_ULTDEP           DATE,
   FEC_ULTREV           DATE,
   CONSTRAINT ACT_HISDETMOV_PK PRIMARY KEY (COD_CIA, COD_MOV, CONSECUTIVO, COD_ACTIVO)
)
INITRANS 1
STORAGE
(
    INITIAL 10K
    NEXT 10K
);

/*==============================================================*/
/* Table: ACT_HISMOV                                            */
/*==============================================================*/
CREATE TABLE ACT_HISMOV  (
   COD_CIA              CHAR(3)                         NOT NULL,
   COD_MOV              CHAR(2)                         NOT NULL,
   CONSECUTIVO          NUMBER(10)                      NOT NULL,
   FEC_MOV              DATE                            NOT NULL,
   FEC_REG              DATE                            NOT NULL,
   DOC_REFEREN          VARCHAR2(10),
   IND_APLICADO         CHAR(1)                         NOT NULL
      CONSTRAINT ACT_HISMOV_IND_APLICA_CK CHECK (IND_APLICADO IN ('S','N')),
   ANO_FISCAL           NUMBER(4)                      
      CONSTRAINT ACT_HISMOV_ANO_FISCAL_CK CHECK (ANO_FISCAL IS NULL OR (ANO_FISCAL > 0 )),
   PER_PROCESO          NUMBER(2)                       NOT NULL
      CONSTRAINT ACT_HISMOV_PERIODO_CK CHECK (PER_PROCESO BETWEEN 1 AND 13),
   DESCRIPCION          VARCHAR2(60),
   NUM_ASIENTO          VARCHAR2(15),
   TIPO                 VARCHAR2(16),
   CONSTRAINT ACT_HISMOV_PK PRIMARY KEY (COD_CIA, COD_MOV, CONSECUTIVO)
)
INITRANS 1
STORAGE
(
    INITIAL 10K
    NEXT 10K
);

/*==============================================================*/
/* Table: ACT_INDICE                                            */
/*==============================================================*/
CREATE TABLE ACT_INDICE  (
   COD_CIA              CHAR(3)                         NOT NULL,
   COD_MONEDA           VARCHAR2(3)                     NOT NULL,
   TIP_INDICE           CHAR(1)                         NOT NULL
      CONSTRAINT ACT_INDICE_TIP_INDICE_CK CHECK (TIP_INDICE IN ('C','I','M')),
   ANO                  NUMBER(4)                       NOT NULL,
   MES                  NUMBER(2)                       NOT NULL,
   VALOR                NUMBER(8,4)                     NOT NULL
      CONSTRAINT ACT_INDICE_VALOR_CK CHECK (VALOR > 0),
   CONSTRAINT ACT_INDICES_PK PRIMARY KEY (COD_CIA, COD_MONEDA, ANO, MES, TIP_INDICE)
)
INITRANS 1
STORAGE
(
    INITIAL 10K
    NEXT 10K
);

/*==============================================================*/
/* Table: ACT_LOCALDET                                          */
/*==============================================================*/
CREATE TABLE ACT_LOCALDET  (
   COD_CIA              CHAR(3)                         NOT NULL,
   COD_LOCALIZA         VARCHAR2(10)                    NOT NULL,
   COD_MONEDA           VARCHAR2(3)                     NOT NULL,
   COD_CTA_DEP          VARCHAR2(25),
   COD_CTA_REV          VARCHAR2(25),
   COD_CTA_GAS          VARCHAR2(25),
   COD_CTA_ING          VARCHAR2(25),
   COD_CTA_CAJA         VARCHAR2(25),
   CONSTRAINT ACTLOCALDET_PK PRIMARY KEY (COD_CIA, COD_LOCALIZA, COD_MONEDA)
)
INITRANS 1
STORAGE
(
    INITIAL 10K
    NEXT 10K
);

/*==============================================================*/
/* Table: ACT_LOCALIZA                                          */
/*==============================================================*/
CREATE TABLE ACT_LOCALIZA  (
   COD_CIA              CHAR(3)                         NOT NULL,
   COD_LOCALIZA         VARCHAR2(10)                    NOT NULL,
   DES_LOCALIZA         VARCHAR2(30)                    NOT NULL,
   CCOSTO               VARCHAR2(7)                     NOT NULL,
   CONSTRAINT ACTLOCALIZA_PK PRIMARY KEY (COD_CIA, COD_LOCALIZA)
)
INITRANS 1
STORAGE
(
    INITIAL 10K
    NEXT 10K
);

/*==============================================================*/
/* Table: ACT_MEJORA                                            */
/*==============================================================*/
CREATE TABLE ACT_MEJORA  (
   COD_CIA              CHAR(3)                         NOT NULL,
   COD_ACTIVO           VARCHAR2(10)                    NOT NULL,
   CONSECUTIVO          NUMBER(10)                      NOT NULL
      CONSTRAINT ACT_MEJORA_CONSECUTIVO_CK CHECK (CONSECUTIVO > 0),
   FEC_MEJORA           DATE                            NOT NULL,
   FEC_ULTDEP           DATE                            NOT NULL,
   FEC_INIDEP           DATE                            NOT NULL,
   MON_MEJORA           NUMBER(14,2)                    NOT NULL
      CONSTRAINT ACT_MEJORA_MON_MEJORA_CK CHECK (MON_MEJORA >= 0),
   VIDA_UTILACT         NUMBER(7)                       NOT NULL
      CONSTRAINT ACT_MEJORA_VIDA_UTILACT_CK CHECK (VIDA_UTILACT > 0),
   VIDA_UTIL            NUMBER(7)                       NOT NULL
      CONSTRAINT ACT_MEJORA_VIDA_UTIL_CK CHECK (VIDA_UTIL >= 0),
   DESCRIPCION          VARCHAR2(60),
   TIPO_CAMBIO_HIST     NUMBER(7,2)                     NOT NULL
      CONSTRAINT ACT_MEJORA_TIPO_CAMBIO_CK CHECK (TIPO_CAMBIO_HIST > 0),
   MON_DEPACU           NUMBER(14,2)                    NOT NULL
      CONSTRAINT ACT_MEJORA_MON_DEPACU_CK CHECK (MON_DEPACU >= 0),
   EST_MEJORA           CHAR(1)                         NOT NULL
      CONSTRAINT ACT_MEJORA_EST_MEJORA_CK CHECK (EST_MEJORA IN ('P','A')),
   CONSTRAINT ACT_MEJORA_PK PRIMARY KEY (COD_CIA, COD_ACTIVO, CONSECUTIVO)
)
INITRANS 1
STORAGE
(
    INITIAL 10K
    NEXT 10K
);

/*==============================================================*/
/* Table: ACT_MOVACT                                            */
/*==============================================================*/
CREATE TABLE ACT_MOVACT  (
   COD_CIA              CHAR(3)                         NOT NULL,
   COD_MOV              CHAR(2)                         NOT NULL,
   CONSECUTIVO          NUMBER(10)                      NOT NULL,
   FEC_MOV              DATE                            NOT NULL,
   FEC_REG              DATE                            NOT NULL,
   DOC_REFEREN          VARCHAR2(10),
   IND_APLICADO         CHAR(1)                         NOT NULL
      CONSTRAINT ACT_MOVACT_IND_APLICADO_CK CHECK (IND_APLICADO IN ('S','N')),
   ANO_FISCAL           NUMBER(4)                      
      CONSTRAINT ACT_MOVACT_ANO_FISCAL_CK CHECK (ANO_FISCAL IS NULL OR (ANO_FISCAL > 0 )),
   PER_PROCESO          NUMBER(2)                      
      CONSTRAINT ACT_MOV_ACT_PERIODO_CK CHECK (PER_PROCESO IS NULL OR (PER_PROCESO BETWEEN 1 AND 13 )),
   DESCRIPCION          VARCHAR2(60),
   NUM_ASIENTO          VARCHAR2(15),
   TIPO                 VARCHAR2(16),
   AUTORIZO             VARCHAR2(30),
   CONSTRAINT ACT_MOVACT_PK PRIMARY KEY (COD_CIA, COD_MOV, CONSECUTIVO)
)
INITRANS 1
STORAGE
(
    INITIAL 10K
    NEXT 10K
);

/*==============================================================*/
/* Table: ACT_MOVCONSE                                          */
/*==============================================================*/
CREATE TABLE ACT_MOVCONSE  (
   COD_CIA              CHAR(3)                         NOT NULL,
   COD_MOV              CHAR(2)                         NOT NULL,
   CONSECUTIVO          NUMBER(10)                     DEFAULT 0 NOT NULL,
   CONSTRAINT ACT_MOVCONSE_PK PRIMARY KEY (COD_CIA, COD_MOV)
)
INITRANS 1
STORAGE
(
    INITIAL 10K
    NEXT 10K
);

/*==============================================================*/
/* Table: ACT_PARAMETRO                                         */
/*==============================================================*/
CREATE TABLE ACT_PARAMETRO  (
   COD_CIA              CHAR(3)                         NOT NULL,
   IND_INT_CONTAB       CHAR(1)                         NOT NULL
      CONSTRAINT ACT_PARAMETRO_INDINT_CONTAB_CK CHECK (IND_INT_CONTAB IN ('S','N')),
   PORCEN_RESIDUAL      NUMBER(4,2)                     NOT NULL,
   MESES_VIGEN_MOV      NUMBER(7)                       NOT NULL,
   MAX_DIAS_DEPREC      NUMBER(6)                       NOT NULL
      CONSTRAINT ACT_PARAMETRO_MAXDIAS_CK CHECK (MAX_DIAS_DEPREC BETWEEN 0 AND 31),
   DEP_PERIODO_DIAS     CHAR(1)                         NOT NULL
      CONSTRAINT ACT_PARAMETRO_DEPDIAS_CK CHECK (DEP_PERIODO_DIAS IN ('P','D')),
   CONSTRAINT ACT_PARAMETRO_PK PRIMARY KEY (COD_CIA)
)
INITRANS 1
STORAGE
(
    INITIAL 10K
    NEXT 10K
);

/*==============================================================*/
/* Table: ACT_TIPMOV                                            */
/*==============================================================*/
CREATE TABLE ACT_TIPMOV  (
   COD_CIA              CHAR(3)                         NOT NULL,
   COD_MOV              CHAR(2)                         NOT NULL,
   TIP_MOV              CHAR(2)                         NOT NULL
      CONSTRAINT ACT_TIPMOV_TIP_MOV_CK CHECK (TIP_MOV IN ('CM','MJ','DP','RT','RV','VN','OT','TR')),
   DES_MOV              VARCHAR2(25)                    NOT NULL,
   REQAUTO              CHAR(1)                         NOT NULL
      CONSTRAINT ACT_TIPMOV_REQAUTO_CK CHECK (REQAUTO IN ('S','N')),
   CONSTRAINT ACT_TIPMOV_PK PRIMARY KEY (COD_CIA, COD_MOV)
)
INITRANS 1
STORAGE
(
    INITIAL 10K
    NEXT 10K
);

ALTER TABLE ACT_ACTIVO
   ADD CONSTRAINT ACTFAMILIA_ACTIVO_FK FOREIGN KEY (COD_CIA, COD_FAMILIA)
      REFERENCES ACT_FAMILIA (COD_CIA, COD_FAMILIA);

ALTER TABLE ACT_ACTIVO
   ADD CONSTRAINT ACTLOCALIZA_ACTIVO_FK FOREIGN KEY (COD_CIA, COD_LOCALIZA)
      REFERENCES ACT_LOCALIZA (COD_CIA, COD_LOCALIZA);

ALTER TABLE ACT_DETMOV
   ADD CONSTRAINT ACTACTIVO_DETMOV_FK FOREIGN KEY (COD_CIA, COD_ACTIVO)
      REFERENCES ACT_ACTIVO (COD_CIA, COD_ACTIVO);

ALTER TABLE ACT_DETMOV
   ADD CONSTRAINT ACTMOVACT_DETMOV_FK FOREIGN KEY (COD_CIA, COD_MOV, CONSECUTIVO)
      REFERENCES ACT_MOVACT (COD_CIA, COD_MOV, CONSECUTIVO);

ALTER TABLE ACT_DETTR
   ADD CONSTRAINT ACTACTIVO_DETTR_FK FOREIGN KEY (COD_CIA, COD_ACTIVO)
      REFERENCES ACT_ACTIVO (COD_CIA, COD_ACTIVO);

ALTER TABLE ACT_DETTR
   ADD CONSTRAINT ACTFAMILIA_DETTR_FK FOREIGN KEY (COD_CIA, COD_FAMILIA)
      REFERENCES ACT_FAMILIA (COD_CIA, COD_FAMILIA);

ALTER TABLE ACT_DETTR
   ADD CONSTRAINT ACTLOCALIZA_DETTR_FK FOREIGN KEY (COD_CIA, COD_LOCALIZA)
      REFERENCES ACT_LOCALIZA (COD_CIA, COD_LOCALIZA);

ALTER TABLE ACT_DETTR
   ADD CONSTRAINT ACTMOVACT_DETTR_FK FOREIGN KEY (COD_CIA, COD_MOV, CONSECUTIVO)
      REFERENCES ACT_MOVACT (COD_CIA, COD_MOV, CONSECUTIVO);

ALTER TABLE ACT_ETIQ
   ADD CONSTRAINT ACTACTIVO_ETIQ_FK FOREIGN KEY (COD_CIA, COD_ACTIVO)
      REFERENCES ACT_ACTIVO (COD_CIA, COD_ACTIVO);

ALTER TABLE ACT_HISDETMOV
   ADD CONSTRAINT ACTHISMOV_HDETMOV_FK FOREIGN KEY (COD_CIA, COD_MOV, CONSECUTIVO)
      REFERENCES ACT_HISMOV (COD_CIA, COD_MOV, CONSECUTIVO);

ALTER TABLE ACT_INDICE
   ADD CONSTRAINT ACTPARAMETRO_INDICE_FK FOREIGN KEY (COD_CIA)
      REFERENCES ACT_PARAMETRO (COD_CIA);

ALTER TABLE ACT_LOCALDET
   ADD CONSTRAINT ACTLOCALIZA_LOCALDET_FK FOREIGN KEY (COD_CIA, COD_LOCALIZA)
      REFERENCES ACT_LOCALIZA (COD_CIA, COD_LOCALIZA);

ALTER TABLE ACT_MEJORA
   ADD CONSTRAINT ACTACTIVO_MEJORA_FK FOREIGN KEY (COD_CIA, COD_ACTIVO)
      REFERENCES ACT_ACTIVO (COD_CIA, COD_ACTIVO);

ALTER TABLE ACT_MOVACT
   ADD CONSTRAINT ACTTIPMOV_MOVACT_FK FOREIGN KEY (COD_CIA, COD_MOV)
      REFERENCES ACT_TIPMOV (COD_CIA, COD_MOV);

ALTER TABLE ACT_MOVCONSE
   ADD CONSTRAINT ACTTIPMOV_MOVCON_FK FOREIGN KEY (COD_CIA, COD_MOV)
      REFERENCES ACT_TIPMOV (COD_CIA, COD_MOV);

ALTER TABLE ACT_TIPMOV
   ADD CONSTRAINT ACTPARAMETRO_TIPMOV_FK FOREIGN KEY (COD_CIA)
      REFERENCES ACT_PARAMETRO (COD_CIA);

