Debugging PL/SQL Web Forms in Toad [message #357074] |
Mon, 03 November 2008 15:25 |
gossep
Messages: 2 Registered: November 2008
|
Junior Member |
|
|
Greetings.
I am doing some work in Banner (the SCT Sungard ERP for educational institutions) and am attempting to use TOAD to debug a PL/SQL web form.
Everything that I've come across thus far indicates that I need to enable debugging, attach the package in TOAD to the external session using Debug > Attach External Session, and then call the web package (http://*****:7778/pls/banqa/bzckschd.p_get_crse_unsec).
Here are the steps I have followed thus far:
1. Execute the following anonymous block via a SQL window in TOAD to get the debug session ready (I don't have SQL *Plus installed, so I did it from a SQL window instead)
DECLARE
id VARCHAR2(255);
BEGIN
id := DBMS_DEBUG.INITIALIZE('PABLO_TEST_DEBUG');
DBMS_DEBUG.DEBUG_ON;
END;
2. Load the package/procedure I want to debug into a pl/sql window in TOAD and set a breakpoint.
3. Select 'Debug > Attach To External Session', and enter 'PABLO_TEST_DEBUG', which I earlier defined as the debug session id.
At this point Toad just spun its wheels for about five minutes, and then a probe query timeout error was received.
On a subsequent attempt executing the anonymous block simply resulted in the query executing for over 20 minutes, at which point I canceled execution.
I'm using TOAD for my development environment, and it's essential that I can get decent debug information. Does anyone have any information that they could share as to what I'm missing here?
Given the depth and complexity of the system I am working in (Banner from SCT Sungard), it is incredibly inefficient to have to insert calls to htp.p to find out where the problem is. This has, at times, resulted in a few hours of testing to track down a problem that with a proper debugging environment would be identified almost instantly.
If anyone could give me any advice or point me to some resources on how to enable debugging within TOAD of pl/sql packages/procedures/functions that are called via the web I would be very, very appreciative.
Thanks,
Pablo
|
|
|
|
Re: Debugging PL/SQL Web Forms in Toad [message #378927 is a reply to message #376617] |
Fri, 02 January 2009 12:59 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
To do simple debugging for pl/sql gateway code from Toad you can do this. It also allows you to single step through the code without issue.
DECLARE
nm OWA.vc_arr;
vl OWA.vc_arr;
l_thepage HTP.htbuf_arr;
l_lines NUMBER DEFAULT 99999999;
BEGIN
-- initialize cgi env with anything your pl/sql needs
nm (1) := 'REMOTE_ADDR';
vl (1) := '1.2.3.4';
-- nm (2) := 'SCRIPT_NAME';
-- vl (2) := '/pls/banqa';
-- nm (3) := 'SCRIPT_PREFIX';
-- vl (3) := '/pls';
OWA.init_cgi_env (nm.COUNT, nm, vl);
-- call your web code
bzckschd.p_get_crse_unsec (...);
OWA.get_page (l_thepage, l_lines);
-- print HTTP buffer using dbms_output
FOR i IN 1 .. l_lines
LOOP
DBMS_OUTPUT.put_line (l_thepage (i));
END LOOP;
END;
/
|
|
|
|
|
|
Re: Debugging PL/SQL Web Forms in Toad [message #455743 is a reply to message #455739] |
Wed, 12 May 2010 13:29 |
|
BlackSwan
Messages: 26766 Registered: January 2009 Location: SoCal
|
Senior Member |
|
|
You have essentially said -
my problem is like this other guy's problem
tell me how to fix it.
We don't know what you have.
We don't know what you do.
We don't know what you see.
It is really, really, REALLY difficult to fix a problem that can not be seen.
use COPY & PASTE so we can see what you do & how Oracle responds.
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
|
|
|