IBM Database Add-Ins for Visual Studio  

Creating DB2 CLR Procedures  (DB2 for Linux, UNIX, and Windows)

The IBM® Database Add-Ins for Visual Studio simplify the process of creating DB2® Common Language Runtime (CLR) procedures by providing a wizard to help you convert existing C# or Visual Basic methods into DB2 Universal Database procedures. With the DB2 CLR Procedure wizard, you can choose an existing C# or Visual Basic method from an IBM database project. Using the wizard, you can specify the parameters and additional options and customize the generated source code by specifying files that contain specific code fragments.

Note:  You can create DB2 CLR procedures only on a DB2 for Linux®, UNIX®, and Windows®, Version 9 or later data server.

To create a DB2 CLR procedure from an IBM database project by using the wizard (from the Solution Explorer):

  1. In the Solution Explorer under your IBM database project, right-click the Procedures folder, select Add on the shortcut menu, and then select Add New Item.
  2. In the Add New Item window, select DB2 CLR Procedure Wizard, type a name for the new procedure file, and then click Add.

    The DB2 CLR Procedure Wizard opens.

  3. Complete the necessary steps of the wizard.

    For detailed information about fields in the wizard, see DB2 CLR Procedure Wizard.

  4. Click Finish.

    The DB2 CLR procedure file is created and added to your project.

To create a DB2 CLR procedure by using the wizard (from the Server Explorer):

  1. In the Server Explorer, right-click Procedures under your data connection, and then select Add New CLR Procedure with Wizard on the shortcut menu.

    The DB2 CLR Procedure Wizard opens. For detailed information about fields in the wizard, see DB2 CLR Procedure Wizard.

  2. Click Finish.

    Based on the options that you select on the Project Selection page in the wizard:

    • The script is created and stored in an IBM database project.
    • The script is run against the database and the DB2 CLR procedure is created.

See Also

Developing DB2 CLR Procedures | DB2 CLR Procedures | Changing DB2 CLR Assembly Properties | Managing Procedures, Functions, and Objects


.NET Development Forum   DB2 FAQs

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