Subject | RE: Database update problem |
---|---|
Author | Riho-Rene Ellermaa |
Post date | 2004-09-23T10:06:10Z |
They have Interbase 6.0.0.627 and I use FB 1.3
Script:
SET AUTODDL ON;
ALTER TABLE CORRESP add COL Varchar(35) NOT NULL;
update corresp set col='';
update corresp set cref='' where cref is null;
update corresp set col=cref;
alter table corresp drop cref;
alter table corresp add CREF Varchar(35) NOT NULL;
update corresp set cref=col;
commit;
alter table corresp drop col;
alter table corresp drop CONSTRAINT CORRESP_PK;
<--------------suspected line
commit;
alter table corresp ADD CONSTRAINT CORRESP_PK PRIMARY KEY
(NAME,ACCOUNT,SUBACCOUNT,CREF);
commit;
Riho Ellermaa
Script:
SET AUTODDL ON;
ALTER TABLE CORRESP add COL Varchar(35) NOT NULL;
update corresp set col='';
update corresp set cref='' where cref is null;
update corresp set col=cref;
alter table corresp drop cref;
alter table corresp add CREF Varchar(35) NOT NULL;
update corresp set cref=col;
commit;
alter table corresp drop col;
alter table corresp drop CONSTRAINT CORRESP_PK;
<--------------suspected line
commit;
alter table corresp ADD CONSTRAINT CORRESP_PK PRIMARY KEY
(NAME,ACCOUNT,SUBACCOUNT,CREF);
commit;
Riho Ellermaa