Subject Re: [IBO] Problem with script
Author Lucas Franzen
Riho-Rene

Riho-Rene Ellermaa wrote:

> I use IBO4.2 Ib, BCB5
>
> I run TIB_Script:
>
> SET AUTODDL ON;
> ALTER TABLE CORRESP add COL Varchar(35) NOT NULL;
> commit;
> update corresp set col='';
> update corresp set cref='' where cref is null;

[snip]

> In Firebird servers this script works perfectly.
> When using IB 6.0, I get error in last row (ADD CONSTRAINT):
> ISC ERROR: 335544349
> Attempt to store duplicate value (...) in unique index
> "RDB$PRIMARY43"
> Null segment of UNIQUE KEY
> Strange thing is that when I run this script in IBAdmin or IB Manager,
> then I don't get this error - the script runs OK.
>
> Can anyone give me a solution to get the script working inside IBO?

I never got this working within IBO since the metadata is cached.
Use several scripts for this and disconnect/reconnect between executing
them.

I'd never use

commit;

within a script since if sth. fails you don't know what was already
committed and what wasn't.


Luc.