[英]How to debug a trigger in Oracle SQL developer (version 20.4.1.407)?
I have the following before-insert trigger, that assigns a sequence number to a record of an intersection table:我有以下插入前触发器,它将序列号分配给交集表的记录:
before insert on psln
for each row
declare v_seqnr number;
begin
select nvl(max(psln_seqnr),0) into v_seqnr from psln where pers_id = :new.pers_id;
:new.psln_seqnr := v_seqnr + 1;
end;
Now i want to debug this trigger to see if v_seqnr gets the proper value, depending on the value of:new.pers_id.现在我想调试此触发器以查看 v_seqnr 是否获得正确的值,具体取决于:new.pers_id 的值。 These are the steps i take:
这些是我采取的步骤:
(when i choose a different option, my stack window remains empty while debugging, see below) (当我选择不同的选项时,我的堆栈 window 在调试时保持为空,见下文)
Can someone please explain me what i am doing wrong or what i have forgotten?有人可以向我解释我做错了什么或我忘记了什么吗?
I think this is a known bug, in SQLDEVELOPER, one fix for it, could be instead of use an ANNONIMOUS PROCEDURE (which is created when you type in the "lady bug"), you can try to fire the trigger by a normal STORE PROCEDURE, that means, you can create a "dummy", procedure which emulates the insert, compile it for debug, an run it, if all work well, your execution should stops in the trigger's break point, is like to do a simulation of debug a procedure which has a trigger in.我认为这是一个已知的错误,在 SQLDEVELOPER 中,一个修复程序可以代替使用 ANNONIMOUS PROCEDURE(当您输入“lady bug”时创建),您可以尝试通过普通 STORE 触发触发器PROCEDURE,这意味着,您可以创建一个模拟插入的“虚拟”过程,编译它进行调试,运行它,如果一切正常,您的执行应该在触发器的断点处停止,就像模拟调试一个有触发器的过程。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.