Yes you can use the commit statement inside a trigger.
I give you two scenarios:
1- You have a button item in a canvas and in it's trigger WHEN-BUTTON-PRESS you have an insert statement, so you want to save the insertion you must use a commit statement.
2- You want to overwrite for example a trigger that already has the commit functionality but you want to perform a validation before use the commit statement.
Hope my explanation helps you :)
Assuming you are talking about Forms triggers and not database triggers...
It depends on the trigger. If it is just a when-button-pressed trigger on a "Save" or "Commit" button, then yes.
I wouldn't use a commit after a sql Insert, because doing a commit anywhere in your form commits ALL work done up to that point.
Hi Steve ,
I am talking about database triggers.I got this question in an interview.This is one part of the question.
The other part is:
Can we write DML statements in trigger?If yes then where this statements will be commited?
Thanks in advance for Your help.
Thanks & Regards,