Subject Re: unsucessful metadata
Author alex_vnru
--- In ib-support@y..., Benny Setiawan Tanua <btanua@b...> wrote:
> i have try your query but i get this error:
>
> Unsuccessful metadata update
> object M_ROLES is in use
> Statement: ALTER TABLE M_ROLES
> ADD CONSTRAINT M_ROLES_FK FOREIGN KEY (PARENT_ROLE_ID) REFERENCES
> M_ROLES(ROLE_ID)

Benny, make shure you are the only one connected to database when do
such metadata changes and try this

Create Table...
Commit;
add primary key...
Commit;

disconnect/connect

add foreign key.
Commit;

IB/FB don't like if "master" table for FK was touched by any
statement even by the single connection before FK creation. You can
define PK in one statement with table creation, this is'nt important.
If you do it by script insert one more connect statement before FK
creation, disconnect will be performed automatically.

Best regards, Alexander V.Nevsky.