‎2009 Nov 23 6:50 AM
Hi All,
I have created 2 table. First is Ztab1 which is check table and second is Ztab2 as foreign key table.
I have created couple of nonprimary key fields in table Ztab2 as foreign key fields, i want to know can i create primary key field in table Ztab2 as foreign key field.
And after creation of foreign key table, i want to know if i'll delete any record from table Ztab1 then should the same record be deleted automatically from table Ztab2 ?
Thnx.
‎2009 Nov 23 6:54 AM
It wont delete automatically.
Try to keep some deletion indicator in your primary table and update it.
Use maintenance view for data manipulation
‎2009 Nov 23 7:11 AM
Thanks for ur reply
Can u please tell me how to set deletion indicator in table ...
can please answer my first questions also
‎2009 Nov 23 7:14 AM
Hi,
Tarun has answered your question.
Just put a new field as like MARA-LVORM.
and when deleting just mark it with a value say 'D' .
so while picking data just ignore where deletion indicator is 'D'.
‎2009 Nov 23 7:10 AM
Hi,
Yes you can keep the primary key fields of ZTAB2 as a part of foreign keys.
And if you delete records from table ZTAB1, then the records from table ZTAB2 won't be deleted automatically.
Instead, you will not be able to delete those records from ZTAB1 because of the foreign key relationship.
For the you need to first delete the records from table ZTAB2 and then delete from ZTAB1.
Hope this helps you.
Regards,
Tarun
‎2009 Nov 23 7:13 AM