/*==============================================================*/ /* Database name: FITBANK PHYSICAL DATA MODEL */ /* DBMS name: IBM DB2 UDB 5.x Common Server */ /* Created on: 24/03/2010 04:54:00 AM */ /*==============================================================*/ -- SQL script that update fitBank squema -- To run this script from the SQL Plus, perform the following steps: -- 1. connect to the database -- 2. set define character to ! -- "set define !" -- 3. issue the command "@ " -- where represents the name of this script -- fitbank201063020.log --alter table TOFICINASUCURSALCODIGOCONTABLE drop constraint FKOFISUCCODCON; --alter table TOFICINASUCURSALCODIGOCONTABLE drop primary key; drop table TOFICINASUCURSALCODIGOCONTABLE; /*==============================================================*/ /* Table: TOFICINASUCURSALCODIGOCONTABLE */ /*==============================================================*/ create table TOFICINASUCURSALCODIGOCONTABLE ( CPERSONA_COMPANIA INTEGER not null, COFICINA INTEGER not null, CSUCURSAL INTEGER not null, VERSIONCONTROL BIGINT default 0, CODIGOCONTABLE VARCHAR(4) not null ); comment on table TOFICINASUCURSALCODIGOCONTABLE is 'Definicion de los codigos contables por sucural oficina'; comment on column TOFICINASUCURSALCODIGOCONTABLE.CPERSONA_COMPANIA is 'Codigo de persona de la compania'; comment on column TOFICINASUCURSALCODIGOCONTABLE.COFICINA is 'Codigo de oficina'; comment on column TOFICINASUCURSALCODIGOCONTABLE.CSUCURSAL is 'Codigo de la sucursal'; comment on column TOFICINASUCURSALCODIGOCONTABLE.VERSIONCONTROL is 'Manejo de optimistic locking.'; comment on column TOFICINASUCURSALCODIGOCONTABLE.CODIGOCONTABLE is 'Codigo contable asociado a la sucursal oficina'; alter table TOFICINASUCURSALCODIGOCONTABLE add constraint IPKOFISUCCODCON primary key (CPERSONA_COMPANIA, COFICINA, CSUCURSAL); alter table TOFICINASUCURSALCODIGOCONTABLE add constraint FKOFISUCCODCON foreign key (CPERSONA_COMPANIA, COFICINA, CSUCURSAL) references TOFICINASSUCURSAL (CPERSONA_COMPANIA, COFICINA, CSUCURSAL);