Subject RE: [IBO] Scripting problem
Author Thomas Steinmaurer
Does it help when you commit the DDL statements before executing a
DML statement?


Regards,
Thomas Steinmaurer
http://www.iblogmanager.com

> -----Original Message-----
> From: Riho-Rene Ellermaa [mailto:r.ellermaa@...]
> Sent: Thursday, April 10, 2003 10:24 AM
> To: IBObject (E-mail)
> Subject: [IBO] Scripting problem
>
>
> 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
>
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>