Subject | Re: [firebird-support] Re: Alter table - how to add ON DELETE CASCADE |
---|---|
Author | Ivan Cruz |
Post date | 2005-08-30T21:03:45Z |
ainpoissee wrote:
select RDB$CONSTRAINT_NAME from RDB$RELATION_CONSTRAINTS
where RDB$RELATION_NAME = 'TAB_KuuYletunnid'
and RDB$CONSTRAINT_TYPE = 'FOREIGN KEY'
and you will recover that name.
The next step is:
alter table TAB_KuuYletunnid drop constraint <name_returned>
Hope it helps.
Ivan.
>Because I create tables using syntax like:Firebird created a name for you. Try:
>
>CREATE TABLE TAB_KuuYletunnid (
> UID DOM_PK PRIMARY KEY,
> Tooleping DOM_FK REFERENCES TAB_Tooleping(UID) ON UPDATE CASCADE,
>...
>);
>
>So I don't know the name of the constraint. But I have to add ON
>DELETE CASCADE to it in update script (I'm using TUIBScript to execute
>scripts).
>
>
>
select RDB$CONSTRAINT_NAME from RDB$RELATION_CONSTRAINTS
where RDB$RELATION_NAME = 'TAB_KuuYletunnid'
and RDB$CONSTRAINT_TYPE = 'FOREIGN KEY'
and you will recover that name.
The next step is:
alter table TAB_KuuYletunnid drop constraint <name_returned>
Hope it helps.
Ivan.