error in deleting record due to foreign key violation [message #290623] |
Sun, 30 December 2007 22:13 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
dmerin
Messages: 30 Registered: December 2007
|
Member |
|
|
Hi,
I CREATED A FORM AND A data block which is database block and one of the column in the table on which the block is based acts as a primary key column which acts as forign key in another table now when i used delete_record so as to delete a record iam gettg error FRM-40510 UNABLE TO DELETE RECORD
I DINT CREATE MASTER DETAILS BLOCK
ONLY MASTER BLOCK IS THERE
HOW TO DELETE RECORDS IN SUCH CASES IAM WORKING IN FORMS 6i
Please help
|
|
|
|
Re: error in deleting record due to foreign key violation [message #290660 is a reply to message #290643] |
Mon, 31 December 2007 01:15 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Referential integrity constraints are created on a DATABASE level, not form level. It doesn't matter that you don't have two blocks in a form; deleting a record which is referenced by another record(s) violates referential integrity and Oracle doesn't allow it.
So: delete detail records first, and then delete master record.
Oracle can make your life easier if you choose to use the ON DELETE CASCADE option while creating foreign keys. It will automatically delete both master AND detail records.
Before posting your next message, please, read the OraFAQ Forum Guide. I believe your problem is urgent for you, but this is just a forum; noone gets paid for answering questions and people do it in their free time. Also, I guess you understand that this is a special time of the year; many of us are on holidays and do not visit the Forum that often. So, either be patient and wait until someone answers the question, or - if it is really urgent - call Oracle Support, pay their fee and (possibly) get an immediate answer.
|
|
|
|
|