Foreign key with ON DELETE CASCADE on a NVARCHAR column not working
726792Dec 13 2011 — edited Dec 13 2011Hi 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