Is this ok with Informix?
Posted in 2004
Topics: Triggers, Constraints & Referential Integrity
Is this syntax legal in Informix?
ALTER TABLE person ADD CONSTRAINT FOREIGN KEY(cnr) REFERENCES comp(cnr)
ON DELETE RESTRICT;
TIA
Carlos San Miguel
Carlos San Miguel wrote:
> Is this syntax legal in Informix?
>
> ALTER TABLE person ADD CONSTRAINT FOREIGN KEY(cnr) REFERENCES comp(cnr)
> ON DELETE RESTRICT;
No - as you must realize since you wouldn't be asking if you hadn't
gotten a syntax error from running the statement.
Download the manuals from:
http://www.ibm.com/software/data/informix/library
Informix does not support the explicit 'ON DELETE RESTRICT' notation,
but does support the concept -- indeed, it does not support any
alternatives, unless you program them through triggered code.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
I'm sure that Jonathan is not implying that IDS does not support cascade
deletes as in ...
......
Create table tab1 (
col1 integer primary key,
...
)
Create table tab2 (col1 char(10) primary key
col2 integer references tab1 (col1) ON DELETE CASCADE
);
which IDS does support...
"Jonathan Leffler" <jleffler@earthlink.net> wrote in message
news:VAHgc.25$eZ5.19@newsread1.news.pas.earthlink.net...
> Carlos San Miguel wrote:
>
> > Is this syntax legal in Informix?
> >
> > ALTER TABLE person ADD CONSTRAINT FOREIGN KEY(cnr) REFERENCES comp(cnr)
> > ON DELETE RESTRICT;>
> No - as you must realize since you wouldn't be asking if you hadn't
> gotten a syntax error from running the statement.
>
> Download the manuals from:
>
> http://www.ibm.com/software/data/informix/library
>
> Informix does not support the explicit 'ON DELETE RESTRICT' notation,
> but does support the concept -- indeed, it does not support any
> alternatives, unless you program them through triggered code.
>
> --
> Jonathan Leffler #include <disclaimer.h>
> Email: jleffler@earthlink.net, jleffler@us.ibm.com
> Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
>