Subject Re: [firebird-support] DEFINE TRIGGER failed no permission for control access to TABLE
Author Dom Scarlatti
At 05:47 PM 6/04/2010, you wrote:
>I run the following statements in the context of a non-admin SQL user:
>
>CREATE TABLE TABLE2
>(
> COL1 SMALLINT NOT NULL,
> COL2 INTEGER NOT NULL,
> COL3 SMALLINT NOT NULL,
> CONSTRAINT PK_TABLE2 PRIMARY KEY (COL1, COL2, COL3)
>);
>
>ALTER TABLE TABLE2 ADD CONSTRAINT FK_TABLE2_COL1
> FOREIGN KEY (COL1) REFERENCES TABLE1
> (ID)
> ON DELETE CASCADE
> ON UPDATE NO ACTION
>;
>
>The CREATE TABLE statement completed successfully. Creating the foreign key caused this error:
>
>"unsuccessful metadata update DEFINE TRIGGER failed no permission for control access to TABLE TABLE1"
>
>I suspect that "cascade delete" in the create statement of the foreign key caused this. Must I create the foreign key by using the admin user or is there another work around? There seems to be no "control" privilege in GRANT.

As SYSDBA or owner of TABLE1:

GRANT REFERENCES ON TABLE1 TO <user>
<user> is the user that needs to create the FK.

Dom