Deleting Records in sys_user table effecting "sys_trigger" and "cmn_notif_device" and "label_history" tables

Devi12
Giga Guru

Hi,

In core_company table I have loaded the vendor data manually including "vendor manager" field. Inserting "Vendor managert" field inserted a vendor contacts in "sys_user" table. As I don't want that data I am trying to delete those user records from "sys_user" table. I have written a background script to delete user records from 'sys_user' table. But deleting a record in user table effecting other tables like "sys_trigger" and "cmn_notif_device" and "label_history".

Here I am attaching the screenshot for the same.

Why it is deleting and inserting records from other tables. Can I delete these records.

Thanks in advance!

 

5 REPLIES 5

Aman Kumar S
Kilo Patron

You have cascade delete available on the sys_user table, so as soon as you are going to delete the user table, its associated records will be deleted as well, it is expected behavior.

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

Best Regards
Aman Kumar

Hi Aman,

Is there any possibility of not deleting the cascaded records? And what is the use of these tables "sys_trigger" and "cmn_notif_device" and "label_history"? I checked in community, I was not able to understand.

Thanks for the reply!

No, it is not possible, unless you disable cascade deletion at the table level.

 

sys_trigger - schedule job would be running next

cmn_notif_dev-
   - Once a record is created in the sys user table, the same will be created in the cmn_notif_dev table as well. Updates go the same way.

  - For example, when the email address of a user is updated in the sys user table, "update email devices" BR will get executed and updates the email address for this user in the cmn_notif_dev table as well

  -   Primary address of a user in the cmn notifies table is used to send Notifications. This will override the email address configured for this user in the sys user table

label_history - It is connected with history sets and stores the level, you can visit this table to understand better

Best Regards
Aman Kumar

I checked the tables already. I am ok deleting record from "cmn_notif_dev" but not sure that deleting record from "label_history". Will it effect others as well that I wanted to know before delete.

And a record is inserting into "sys_trigger" table, Is it ok if a record inserted for a deletion of  a record in "sys_user" table?