Database.ca SQL Server Blog

My Blog

Thursday, February 13 2014

Keywords: Oracle Projects, Visual Studio 2010, 2012, 2013, Debug Oracle Stored Procedures in VS, Oracle 11g, Oracle 12g, Oracle 12c

Debug Oracle 11g or 12c Stored Procedures and Functions in Visual Studio 2013. Part 4 of 5

The blog is part of a series on Oracle Database Development with Visual Studio.
Read Part 1 of series here.
Read Part 2 of series here.
Read Part 3 of series here.
Read Part 5 of series here.
 
I highly recommend that you debug your PL/SQL code from right within Visual Studio as part of your journey to developing highly effective, bullet proof and stable database code.

 

30) In Server Explorer, find GETSTRINGS stored procedure in Procedures, and right click “Compile Debug”. Remember to revert it back to a regular compile at the end.

 

Oracle Projects, Visual Studio 2010, 2012, 2013, Debug Oracle Stored Procedures in VS, Oracle 11g, Oracle 12g, Oracle 12c

31) Double click on "GetStrings" stored procedure, this will open the stored procedure’s script in VS. put some breakpoints…especially on those otherwise useless variables I purposely put in the code for the sole purpose of seeing their value during debug.

 

Oracle Projects, Visual Studio 2010, 2012, 2013, Debug Oracle Stored Procedures in VS, Oracle 11g, Oracle 12g, Oracle 12c

32) Tools --> Options --> Oracle Developer Tools --> Select the database connection you had created in step #12.

 

Oracle Projects, Visual Studio 2010, 2012, 2013, Debug Oracle Stored Procedures in VS, Oracle 11g, Oracle 12g, Oracle 12c

33) Tools --> Oracle Application Debugging --> make sure it is selected.

 

Oracle Projects, Visual Studio 2010, 2012, 2013, Debug Oracle Stored Procedures in VS, Oracle 11g, Oracle 12g, Oracle 12c

34) Open default.aspx.cs and place breakpoints on the line where command.executereader() is, and anywhere else you wish.

 

35) Debug --> Start Debugging. Press F11 to "Step into".

 

36) You could also debug the other stored procedures I had provided in my database sample, they perform Update, Insert and Delete.

 

37) Make sure the “Locals” window is visible during debug. You could also look at the "Watch" window and enter variable names there manually.

 

Oracle Projects, Visual Studio 2010, 2012, 2013, Debug Oracle Stored Procedures in VS, Oracle 11g, Oracle 12g, Oracle 12c

Read Part 1 of series here.
Read Part 2 of series here.
Read Part 3 of series here.
Read Part 5 of series here.

 

Written by Ramin Haghighat