Generate test window in Debug mode

evvcom

Member
I have an idea. When the function / procedure is in debug mode, you can create a test window based on a selected query with the parameters filled in. Values for parameters can be filled with the current debugging values of the variables.
 
connect as user SCOTT

create or replace procedure SCOTT.EMP_PROC(
pCur in out SYS_REFCURSOR,
pDeptNo in EMP.deptno%type
) is
v_deptno EMP.deptno%type;
begin
-- any calculation of a v_deptno
v_deptno := pDeptNo;
open pCur for
select
*
from EMP e
where
e.deptno = v_deptno;
end EMP_PROC;

New test window:

begin
-- Call the procedure
emp_proc(pcur => :pcur,
pdeptno => :pdeptno);
end;

Fill in the values of variables:

pcur Cursor
pdeptno Integer 20

Execute the procedure in debug mode before the line "open pCur for". Then select "select * from EMP e where e.deptno = v_deptno", right-click and select "test". The query is opened in the test window and all variables are filled with the current values. In this example, the variable v_deptno is filled with a value of 20.
 
and additional ideas:
2. Right-click on "select ..." and select new context menu item "Open in SQL window". The query is opened in the SQL window:

Code:
select
*
from EMP e
where
e.deptno = 20

3. Right-click on "select ..." and select new context menu item "Open in SQL window in debug session..."
 
Last edited:
Creating a Debugging Database Connection
To create a database connection, perform the following steps:

1 .

Open SQL Developer.

2 .

In the Connections tab, right-click Connections and select New Connection.

3 .

Enter the following and click Test:

Connection Name: hr_orcl
Username: hr
Password: hr
Select Save Password checkbox
Hostname: localhost
Port: 1521
SID: orcl

4 .

The status of the connection was tested successfully. The connection was not saved however. To save the connection, click Connect.

5 .

Once the connection is saved, you will see the database in the list. When a connection is created, a SQL Worksheet is opened automatically. The SQL Worksheet allows you to execute SQL against the connection you just created. Expand the hr_orcl connection.
 
Last edited:
Back
Top