Subject Re: [firebird-support] Re: Unknown token CREATE
Author Lucas Franzen
edcurren schrieb:
> Ugh! I've seperated the statements and am now running them through
> one at a time. However when I get to a CREATE TABLE statement that
> has a FOREIGN KEY contstraint to a table created 3 sql statments
> prior, I get the following error:
>
> This operation is not defined for system tables.
> unsuccessful metadata update
> object CUSTOMERS is in use
>
> The code does a full attach_db, create_stmt, prep_stmt, execute,
> commit, detach_db cycle for each sql statement. I'm lost folks, and
> in desperate need of help.

in that case (that you detached the db) the problem occurs from another
opened connection which prevents you from having single acess to the
database. This is required when adding a foreign key constraint.

If you think there might be the sth. wrong with detaching, you can test
by trying to rename the database file right after detaching ;-)


Luc.