Hi,
I am currently working with a database, and I am being asked to delete a row from this table. let's call it department with the attributes (dcode CHAR(20), dname CHAR(20)).
Now i have to delete a row that a user inputs via JDBC regarding the dcode.
However I can't do this because the table department is not "ON DELETE CASCADE", and there are other attributes in other tables in this database where that column is a foreign key to that dcode. (ie: they refer to the column dcode in the department table). I was wondering if there was a way to add this constraint to this table.
I tried looking up the ALTER TABLE command but I am not sure how it works.
If any one can help me with this problem, that would be great.
Thank You,
Chota.
I am currently working with a database, and I am being asked to delete a row from this table. let's call it department with the attributes (dcode CHAR(20), dname CHAR(20)).
Now i have to delete a row that a user inputs via JDBC regarding the dcode.
However I can't do this because the table department is not "ON DELETE CASCADE", and there are other attributes in other tables in this database where that column is a foreign key to that dcode. (ie: they refer to the column dcode in the department table). I was wondering if there was a way to add this constraint to this table.
I tried looking up the ALTER TABLE command but I am not sure how it works.
If any one can help me with this problem, that would be great.
Thank You,
Chota.
Comment