/*==============================================================*/ /* Database name: FITBANK PHYSICAL DATA MODEL */ /* DBMS name: IBM DB2 UDB 5.x Common Server */ /* Created on: 14/12/2009 15:06:15 PM */ /*==============================================================*/ -- 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 -- fitbank201062015.log alter table TCUENTACONTADORPAGOS drop constraint FKCTACONPAG; alter table TCUENTACONTADORPAGOS drop constraint FKCTACONPAGESTOPE; alter table TCUENTACONTADORPAGOS drop primary key; drop table TCUENTACONTADORPAGOS; /*==============================================================*/ /* Table: TCUENTACONTADORPAGOS */ /*==============================================================*/ create table TCUENTACONTADORPAGOS ( CCUENTA VARCHAR(19) not null, CPERSONA_COMPANIA INTEGER not null, CESTADOOPERACION VARCHAR(2) not null, NUMEROPAGOS INTEGER ); comment on table TCUENTACONTADORPAGOS is 'Registra el numero de cuotas de pago puntual consecutivo que permite a la operacion regresar del estado reestructurado a operacion normal.'; comment on column TCUENTACONTADORPAGOS.CCUENTA is 'Numero de cuenta'; comment on column TCUENTACONTADORPAGOS.CPERSONA_COMPANIA is 'Codigo de la compania a la que pertenece la cuenta, puede ser externa o compania licenciada'; comment on column TCUENTACONTADORPAGOS.CESTADOOPERACION is 'Codigos del estado de la operacion de credito'; comment on column TCUENTACONTADORPAGOS.NUMEROPAGOS is 'Contador de pagos consecutivos realizados a tiempo'; alter table TCUENTACONTADORPAGOS add constraint IPKCONTPAGOS primary key (CCUENTA, CPERSONA_COMPANIA, CESTADOOPERACION); alter table TCUENTACONTADORPAGOS add constraint FKCTACONPAG foreign key (CCUENTA, CPERSONA_COMPANIA) references TCUENTAID (CCUENTA, CPERSONA_COMPANIA); alter table TCUENTACONTADORPAGOS add constraint FKCTACONPAGESTOPE foreign key (CESTADOOPERACION) references TESTADOOPERACIONID (CESTADOOPERACION);