Subject Scripting problem
Author Riho-Rene Ellermaa
When I try to run following script in IBO, I get error
ISC ERROR CODE:335544349
ISC ERROR MESSAGE:
attempt to store duplicate value (visible to active transactions) in unique index "RDB$PRIMARY60"
null segment of UNIQUE KEY
STATEMENT:
TIB_DSQL: "<TApplication>.frmSQL.frmScript.IB_Script.<TIB_DSQL>."
SQL ERROR CODE:-803
SQL ERROR MESSAGE:
Invalid insert or update value(s): object columns are
constrained - no 2 table rows can have duplicate column values
The offending row is shown to be "commit"


When I look at the RDB$INDICES, the largest number is PRIMARY59.
When I run this script in IBAdmin, it runs perfectly and does everything necessary.
What does IBO differently and what should I do to get it work?

Script:
ALTER TABLE CORRESP
add COUNTRY Varchar(3),
add SUBACCOUNT Varchar(16),
add BALCODE Varchar(3);

update version set ver=7203;
commit;

ALTER TABLE CORRESP DROP CONSTRAINT CORRESP_PK;
ALTER TABLE CORRESP DROP SUBACCOUNT;
ALTER TABLE CORRESP ADD SUBACCOUNT VARCHAR(16) NOT NULL;
update corresp set subaccount='' where subaccount is null;
ALTER TABLE CORRESP ADD CONSTRAINT CORRESP_PK PRIMARY KEY (NAME,ACCOUNT,SUBACCOUNT);
update version set ver=7204;
commit;



Riho-Rene Ellermaa
senior programmer
Hansabank