INFORMIX DataBlade Developers Kit Tutorial

List of Exercises

Tutorial Exercise 1

Creating a Simple User-Defined Routine

This exercise demonstrates how to use the tools of the DataBlade Developers Kit-- BladeSmith and BladeManager-- to create a DataBlade module with a user-defined routine.

The AddInts DataBlade module is very simple: it creates a function, AddIntegers(), which adds two integers and returns the result.

Overview of Steps

You follow these basic steps to create the AddInts DataBlade module:

    1. Use BladeSmith to create the AddInts DataBlade module project.

    2. Use BladeSmith to create the AddIntegers() function.

    3. Use BladeSmith to generate the source code and the SQL registration scripts.

    4. Add code for the AddIntegers() function to the template generated by BladeSmith.

    5. Compile your source code using your C compiler.

    6. Install your DataBlade module.

    7. Start the database server.

    8. Create a test database.

    9. Register your DataBlade module.

    10. Run your DataBlade module.

These steps are fully explained in this exercise.

Tutorial Steps

This exercise consists of 10 steps. It takes approximately 45 minutes to complete.


1

Use BladeSmith to create the AddInts DataBlade module project.

Start BladeSmith from the Informix program group.

Choose Project New and enter the following information in the first page of the New Project wizard.

The Object Prefix, Description Locale, and Server compatibility fields are mandatory; the rest are optional.

Click Next and enter information about your company in the second page of the wizard.

Click Next and the last page of the New Project wizard displays a preview of the SQL generated to define the DataBlade module object to the database server. Most BladeSmith wizards that you use to define a new object display the SQL statements they generate.

Click Finish to create the project. BladeSmith displays the new project and its folders.

The Files, Imported Objects, and User Defined Objects folders are currently empty, but as you build your DataBlade module, the objects you add appear in this hierarchy.

Choose Project Save to save the new DataBlade module. The Save As dialog box opens because this is the first time you are saving this project. Create a directory called AddInts in any convenient place on your hard drive and save your project as the file AddInts.ibs in this directory.


Copyright © 1998, Informix Software, Inc. All rights reserved.