This post will help developers and unit testers to test oracle procedure using PL/SQL Developer.
Lets start step by step procedure to unit test a procedure.
I am assuming that you already have a PL/SQL developer and a procedure created in it.
I have a Procedure called PKG_Test and it have two input parameters and a output cursor.
Step 1: just open a browser window in PL/SQL Developer by Checking Tools-> Browser option.
Step 2: Search for procedure and right Click on it and click the View Spec and Body option.
Step 3: Now Package is open in new window just right click on procedure name and click on test option in menu.
Step 4: Test window opened now to start unit testing (Debugging) just enter the input parameter if any and click on Start Debugger button or F9.
Step 5: Now cursor goes inside the procedure block . there is options to stop testing execute all blocks and step over and step out.
Let me explain all things clearly.
you can test the variable values at any point of debugging time, just go to Script tab and insert in the variable name under variable column and you will get current value of the variable under value column.
This program is just to demonstrate the debugging process in PL/SQL developer, we haven't used any passed parameter in this. you can use as per your requirement.
Step 6: Now procedure run is over and you can check the results at Cursor … icon.
Once the debugging is complete you can check the results of procedure in test window cursor column.
Step 7: A new result window opened and you can see the results in window.
This procedure of block is returning 3 rows which contains the 'c' character in name column.
Now you can debug the complex procedures. Happy testing.