I'm trying to get control of a recursive trigger over DB2 (v9.7), unfortunately IBM documentation doesn't mention a way to know at which level of recursion the current trigger call is in.
I've found that there's this function on sql-server: trigger_nestlevel()
, it basically does what I want (knowing the actual trigger recursive call level). so I would like to know if there is an equivalent function in DB2.
Unfortunately DB2 does NOT have any function or stored procedure for this. You can have maximum of 16 trigger cascade levels.
It is hard coded and can not be changed.
BTW in DB2, if a trigger causes another trigger to be fired, it is called trigger cascade. And you can avoid cascading by NO CASCADE keyword.
If you want to avoid the call to same trigger, there is a workaround:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.