By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,441 Members | 996 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,441 IT Pros & Developers. It's quick & easy.

ALTER TABLE command?

P: 1

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,
Aug 3 '08 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 700
I'm not sure it ALTER TABLE allows to add CASCADE removing to a table. You can solve this writing a rule or a trigger (or recreate table with CASCADE removing)
Aug 7 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.