Building .NET CLR routine code

When .NET CLR routine implementation code is written, it must be compiled and deployed before the routine can be called. The steps that are required to build .NET CLR routines are similar to steps for building other external routines.

Before you begin

Attention: With the release of Db2 11.5.9, support for Microsoft .Net common language runtime (CLR) routines is deprecated and might be removed in the future. If you are currently running routines that have a dependency on .NET CLR, rewrite the routine logic in a supported language and then recreate the routines.

Procedure

There are three ways to build .NET CLR routines:
  • Using the graphical tool that is provided with the IBM® Database Add-Ins for Microsoft Visual Studio
  • Using sample batch files
  • Entering commands from the Db2® command window

The sample build scripts and batch files for routines are designed for building database sample routines (procedures and user-defined functions) as well as user created routines for a particular operating system using the default supported compilers.

There is a separate set of sample build scripts and batch files for C# and Visual Basic. It is easier to build .NET CLR routines using the graphical tools or the build scripts, which can be modified as required. However, it is often helpful to know how to build routines from the Db2 command window.