How can delete a record in a master-detail relation

How can delete a record in a master-detail relation

Post by nick04 » Sun, 17 Feb 2008 17:29:31


Hi to All,

I have created a Form with 3 Blocks:
1) MASTERBLOCK, Table1, PK MASTER_CODE
2) DETAILBLOCK, Table2, KEY = DETAIL_CODE
3) TOOLBAR with button SAVE, ADD, DELETE etc...

All Work fine! I can Add, Modify, Save all in the Master and in Detail
Block.

But If I try to Delete a Master Record, this message is displayed:

CANNOT DELETE THE MASTER RECORD IF THERE ARE CORRESPONDING DETAIL
RECORDS (NB. I have translated the message from italian language)

In the trigger WHEN-BUTTON-PRESSED of DELETE Button I have entered:

Delete_Record ;

Please can anyone help me in order to delete the master and the detail
records?

Thank You and Best Regards
Gaetano
 
 
 

How can delete a record in a master-detail relation

Post by nick04 » Mon, 18 Feb 2008 01:20:45


I have solved. In relations I have set to cascading the property.
Bye
Gaetano

 
 
 

How can delete a record in a master-detail relation

Post by DA Morga » Tue, 19 Feb 2008 05:44:29


Delete the detail records first.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
XXXX@XXXXX.COM (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
 
 
 

How can delete a record in a master-detail relation

Post by paul » Tue, 26 Feb 2008 05:29:49

 
 
 

How can delete a record in a master-detail relation

Post by yf11 » Tue, 26 Feb 2008 12:59:40


: > Hi to All,
: >
: > I have created a Form with 3 Blocks:
: > 1) MASTERBLOCK, Table1, PK MASTER_CODE
: > 2) DETAILBLOCK, Table2, KEY = DETAIL_CODE
: > 3) TOOLBAR with button SAVE, ADD, DELETE etc...
: >
: > All Work fine! I can Add, Modify, Save all in the Master and in Detail
: > Block.
: >
: > But If I try to Delete a Master Record, this message is displayed:
: >
: > CANNOT DELETE THE MASTER RECORD IF THERE ARE CORRESPONDING DETAIL
: > RECORDS (NB. I have translated the message from italian language)
: >
: > In the trigger WHEN-BUTTON-PRESSED of DELETE Button I have entered:
: >
: > Delete_Record ;
: >
: > Please can anyone help me in order to delete the master and the detail
: > records?
: >
: > Thank You and Best Regards
: > Gaetano

: Cascade delete
: http://www.yqcomputer.com/

Or Form trigger PRE-DELETE (spelling?), at the Block level
is the hook that allows you to delete them yourself just before Forms runs
the delete command for the master.