Discussion:
Cascade Delete
(too old to reply)
c***@hotmail.com
2007-09-04 02:26:55 UTC
Permalink
How to perform cascade delete in DB2 tables?

Or I not need to do anything,
Just delete the master table records, and DB2 will automatically delete child records in child tables?

Thanks in Advance.
Mark A
2007-09-04 03:14:43 UTC
Permalink
Post by c***@hotmail.com
How to perform cascade delete in DB2 tables?
Or I not need to do anything,
Just delete the master table records, and DB2 will automatically delete
child records in child tables?
Thanks in Advance.
If there is a referential constraint on the child defined with cascade
delete (the default is no action which is similar to restrict), then if you
delete the parent, all the children will be deleted.
c***@hotmail.com
2007-09-04 03:39:27 UTC
Permalink
If I am not mistaken referential constraint only can define during CREATE TABLE and ALTER TABLE, am I right?

BTW, How to display the created table structure?
Thanks.
Mark A
2007-09-04 05:36:29 UTC
Permalink
Post by c***@hotmail.com
If I am not mistaken referential constraint only can define during CREATE
TABLE and ALTER TABLE, am I right?
BTW, How to display the created table structure?
Thanks.
Yes, table constraints are defined in create table and alter table. Please
refer the SQL Reference Vol 2.

I don't believe you can display FK constraints from the command line. You
can query the catalog, or use the Control Center GUI.
c***@hotmail.com
2007-09-04 06:38:01 UTC
Permalink
Thanks Mark.

You always been helpful.
Thank You.

Continue reading on narkive:
Loading...