Learn to use PL / SQL Developer's debugging features for writing complex stored procedures, packages, funtion ... very helpful, so tonight to learn a bit:
(1) Set a breakpoint in the body (want to set a breakpoint in the line began to click the left mouse button).
(2) Right-click on TEST.
Window will appear as follows TEST WINDOWS
Red circle in the location in the following input parameter value field value, because varstr is an input parameter, where to enter a value, but io_cursor the input and output parameters, output parameters are not in this as a pre-entered values
(3) Debug -> Start.
If the above steps in the debug - start can not click on the gray, it is because the user is not assigned to this transfer of authority,
If you click on the words of the implementation pl / sql developer to debug stored procedure error
note: debugging requires the debug connect session system privilege.
The reason is not enough user privileges, use the following command to grant permissions:
Sysdba role with username, use the following command
GRANT debug any procedure, debug connect session TO username
(4) Click the red button for single-frame stepping, the body automatically will jump to the stored procedure.
(5) the mouse into the variable can be shown that the variable value.
You can also right-click the mouse outside the chain of variable selection Add variable to Watches
At this point the next red circle in the value of the variable listed
South Point on the map in bold red button pops up the following dialog box shows details of the variable value
The following is to create a simple stored procedure example
CREATE OR REPLACE PACKAGE u_pg_test as
TYPE t_cursor IS REF CURSOR;
Procedure u_sp_test (varStr varchar2, io_cursor IN OUT t_cursor);
CREATE OR REPLACE PACKAGE BODY u_pg_test AS
Procedure u_sp_test (varStr varchar2, io_cursor IN OUT t_cursor) IS
varSql varchar2 (666);
varSql: = 'Select * aa where ANAME ='''|| varStr ||'''';
OPEN v_cursor FOR varSql;
io_cursor: = v_cursor;