Subject RE: [firebird-support] RE: Database update problem
Author Thomas Steinmaurer
> Script:
> SET AUTODDL ON;
> ALTER TABLE CORRESP add COL Varchar(35) NOT NULL;

COMMIT; <---- missing

> update corresp set col='';
> update corresp set cref='' where cref is null;
> update corresp set col=cref;

Do a commit here as well.

> alter table corresp drop cref;
> alter table corresp add CREF Varchar(35) NOT NULL;

Again, COMMIT DDL changes, before using them in a DML
statement.

> 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);

So, the statement which creates the primary key constraint
fails?

Are you sure that all fields are declared as NOT NULL?


Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database and MS SQL Server
Upscene Productions
http://www.upscene.com