Tutorial exercise 1: Creating a simple user-defined routine

This exercise demonstrates how to use the tools of the -- BladeSmith and the DBDK Visual C++ Add-In--to create a module with a user-defined routine and to debug it.

About this task

The AddInts module has one function, AddIntegers(), which adds two integers and returns the result.

You follow these basic steps to create the AddInts module:

Procedure

  1. Use BladeSmith to create the AddInts module project.
  2. Use BladeSmith to create the AddIntegers() function.
  3. Use BladeSmith to generate the module code.
  4. Create a test database.
  5. Add code for the AddInts() function to the code generated by BladeSmith.
  6. Compile and install your source code by using Microsoft Visual C++.
  7. Set a breakpoint for the AddInts() function.
  8. Edit the AddInts.sql unit test file.
  9. Click the Debug Module button on the add-in toolbar to start debugging

Results