IBM Database Add-Ins for Visual Studio  

Enabling SQL, SQL PL, and SPL Debugging in CLR Applications

If you want to debug DB2® SQL and SQL PL procedures or IDS SPL procedures in your C# or Visual Basic application, you first must enable SQL, SQL PL, and SPL debugging for the development project. You need to do this process only once for a given project. Enabling SQL, SQL PL, and SPL debugging for a project sets a project property that persists from session to session in Visual Studio.

For an IDS database In IDS SPL procedures, you can debug only the SPL statements, not the SQL statements.

When you enable SQL, SQL PL, and SPL debugging in a development project, the IBM Unified Debugger must close and then reopen the CLR application that contains the project. After the project reopens, you must specify the data connection and, optionally, the port on which to run the debugger session manager. You must also change the settings of some standard Visual Studio project debug properties.

The add-ins, which is 32-bit application, does not support a 64-bit debugging process for console applications. On a 64-bit operating system, the default debug platform is Any CPU, which is a 64-bit debugging process. You must specify a 32-bit debug platform in the project properties.

Prerequisite: To enable IBM SQL, SQL PL, and SPL debugging in a CLR application, the application that contains the development project must be open in the Solution Explorer.

To enable SQL, SQL PL, and SPL debugging in a CLR application:

  1. In the Solution Explorer right-click the development project node, and then select Enable IBM SQL and SPL Debugging.

    A message is displayed that the project must be closed and reopened.

  2. Click Yes in the message window to confirm the closing and reopening of the project.

    All unsaved changes are saved, the project closes, and then reopens in the Solution Explorer.

  3. In the Solution Explorer, right-click the development project node, and then select Properties.

    The Project Designer opens.

  4. In the left box of the designer, click IBM Unified Debugger.

    The IBM Unified Debugger page is displayed.

  5. Perform one of the following sets of actions:
    • If you have one of the following connections to use for the debugger session manager:
      • DB2 for Linux®, UNIX®, and Windows®, Version 9.1, or later
      • DB2 for z/OS® Version 9 new function mode (NFM), Version 10 in Version 9 conversion mode (CM), or Version 10 NFM
      • DB2 for i V5R4, V6R1, or V7R1
      • IDS Version 11.70
      1. Select Use an existing connection for session manager.
      2. In the list, select the data connection on which to run the debugger session manager.
    • If you are running the debugger session manager manually:
      1. Select Use a new host name for session manager.
      2. Specify a host name for the debugger session manager.
  6. Optional: In the Session manager port field, type the port on which to run the debugger session manager.

    If you leave the field blank, or specify the value 0 or default, the default port that is defined for the server is used.

  7. In the left box of the designer, click Debug.

    The Debug page of the Project Designer is displayed.

  8. Change the following properties on the Debug page:
    • Under Start Options, clear the Use remote machine check box.
    • Under Enable Debuggers, clear all three of the following check boxes:
      • Enable unmanaged code debugging
      • Enable SQL Server debugging
      • Enable the Visual Studio hosting process
  9. Close the Project Designer.

When you debug an application development project, you now can debug the SQL or SPL procedures in the application as well.


See Also

SQL, SQL PL, and SPL Procedure Debugging in CLR Applications | Debugging SQL, SQL PL, and SPL Procedures in CLR Applications | IBM Unified Debugger Page, Project Designer


.NET Development Forum   developerWorks: Visual Studio .NET   DB2 FAQs   IDS FAQs

© Copyright IBM Corporation 2002, 2012. All Rights Reserved.