Re: Is this ok with Informix?
Posted in 2004
Madison Pruet wrote:
> I'm sure that Jonathan is not implying that IDS does not support cascade
> deletes as in ...
Actually I was - but I was misthinking and hence mistaken. :-(
It is the cascade update that isn't supported. And ON DELETE RESTRICT
is also not supported by explicit syntax, as I said originally.
And while I was checking my mistake, I looked at the manual
(c1sqna.pdf for 9.40 Guide to SQL: Syntax) and noted that on p2-214,
the railroad diagram clearly implies that all multi-column constraints
must follow all the column definitions, whereas I'm 99% sure that you
can interleave them as long as any columns referenced by the
multi-column constraint have already been defined.
CREATE TABLE pqr
(
s integer not null check (s > 0),
t integer not null check(t < 0),
primary key (s, t) constraint pk_pqr,
u integer not null
);
> 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:
>>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 (jleffler@earthlink.net, jleffler@us.ibm.com)
#include <disclaimer.h>
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/