Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Foreign key with ON DELETE CASCADE on a NVARCHAR column not working

726792Dec 13 2011 — edited Dec 13 2011
Hi guys!

I hope you can help me or give me an advice.
I use foreign keys with the option "on delete cascade". The datatype of the primary key fields in NVARCHAR (I have to use this because its an requirement of the application we use).
Now I've seen that deleting a row in a parent table doesn't delete the associated detail row. It's still there. No error nothing.
Other thins work fine (Inserting a row in the detail table with no associated parent raises an exception etc.)
If I change the fields to the VARCHAR-Datatype everything works as expected. But as mentioned above thats no solution.

I've tried this in Oracle 9i, 10g, 11g and the behaviour is anywhere the same.

Is this a general restriction? Or is the something I can do that this option works?

Thanks in advance and kind regards
Peter
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 10 2012
Added on Dec 13 2011
4 comments
309 views