Database.ca SQL Server Blog

My Blog

Saturday, April 05 2014

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

Running Oracle stored procedures and viewing the output results in Visual Studio. Part 5 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 4 of series here.

 

38) You could easily run Oracle stored procedures in Visual Studio and visualize the values of all the parameters without using a plugin or a third party tool such as Toad.
 
Since Oracle stored procedures output record sets in form of 'REFCURSOR' type parameters...then the 'value' of those output parameters could also be viewed.

 

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

In "Server Explorer", under your Oracle connection... you have the choice of either to either "Run" the stored procedure or "Run Debug" where you would also step into the code. It is important to note that by running stored procedures directly from "Server Explorer" you are interacting directly with the Oracle database server and are not interacting with your Visual Studio solution in any ways.

 

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

39) After running a stored procedure, a new page will automatically open up, with a table in it displaying all the Out Parameters. If you want to see the record sets returned by REFCURSOR output parameter of stored procedures, then click on the corresponding table cell called "value".

 

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

The output data is then displayed.

 

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

40) I edited the stored procedure right within Server Explorer, by adding a second output column (DateTime field), and then I ran the procedure again, just to show how it displays multiple column outputs.

 

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 4 of series here.

 

 

 

 

Written by Ramin Haghighat