Ah, okay, I see the communication failure now. I used your package and tested it both way and I see what you mean, and I agree that it works as I would expect that way.
Now, change the package body like this:
CREATE
OR
REPLACE
PACKAGE
BODY
DG_ABPPTM.debugstuff
AS
v_test VARCHAR2(1)
:=
‘x’;
v_date DATE;
FUNCTION TestStep(in_val NUMBER)
RETURN
NUMBER
IS
BEGIN
RETURN testvar + package_var + in_val;
END TestStep;
BEGIN
SELECT
SYSDATE
INTO v_date FROM DUAL;
END
debugstuff;
/
When you step into it, without regard to how the option is set, it will step first to all package BODY variables that have initial values, then to the package initialization, in this case the ‘select sysdate into…’ at the end of the package, then to the function. Maybe we are misinterpreting the definition of “package initialization”. To us that means variables in the spec as well as the body and we also consider the begin/end logic to be package initialization. We use that all the time for global variable default initialization.
Of course if I ‘run to cursor’ via F12 on the first line of the function/procedure then it bypasses all of that and starts at the selected line.
From: Gregory Liss [mailto:bounce-GTDG@toadworld.com]
Sent: Thursday, August 13, 2015 1:40 PM
To: toadoraclebeta@toadworld.com
Subject: RE: [Toad for Oracle - Beta Discussion Forum] Step through package initialization
RE: Step through package initialization
Reply by Gregory Liss
Chris,
I’m not sure why it’s not working for you. I just whipped up a quick sample and with that option unchecked, it doesn’t step through the package initialization and if I check it, it does step through (using Trace into (Shift F7) to debug into). What exactly are you seeing?
Thanks,
Greg
create
or
replace
package
debugstuff
is
testvar number
:=
6;
package_var number
:=
4;
function TestStep (in_val number)
return
number;
end
debugstuff;
/
drop
package
body
DEBUGSTUFF;
create
or
replace
package
body
debugstuff
as
function TestStep (in_val number)
return
number
is
begin
return testvar + package_var + in_val;
end TestStep;
end
debugstuff;
/
To reply, please reply-all to this email.
Stop receiving emails on this subject.
Or
Unsubscribe from Toad for Oracle - Beta notifications altogether.
Toad for Oracle - Beta Discussion Forum
Flag
this post as spam/abuse.