This content has been marked as final. Show 1 reply
welcome to the forum.
Need to disable a database trigger on tablesYou can use
But before you do it you should ask
EXECUTE IMMEDIATE 'ALTER TRIGGER <trigger_name> DISABLE '
* why it is necessary to disable the trigger?
* how can you guarantee that the trigger will be enabled when your transaction is finished?
A better solution might be to set a flag, for example a global variable in a package. When the trigger fires it reads the value of the flag and depending on the value it will execute some code or not.
PACKAGE global_vars ... g_allow_insert BOOLEAN := FALSE; g_insert_not_allowed EXCEPTION;
Now in your forms you can set global_vars.g_allow_insert = TRUE and the trigger will be "disabled".
TRIGGER on some_table IF NOT global_vars.g_allow_insert THEN RAISE global_vars.g_insert_not_allowed; END IF;
The trigger will be "enabled" for other sessions and therefore if your forms session is interrupted, you don't have to muse about how to enable the trigger.