INFORMIX DataBlade Developers Kit Tutorial

List of Exercises

Exercise 1: Creating a Simple User-Defined Routine, continued


5

Compile your source code using your C compiler.

When you generate source code, BladeSmith creates three makefiles in the src\C directory. The instructions in this exercise use the AddInts.mak Microsoft Developer Studio Visual C++ file to compile the source code into the AddInts.bld dynamic link library file.

For information about compiling on UNIX, see the DataBlade Developers Kit User's Guide.

See " Setting Informix Directories in Microsoft Visual C++" for instructions on configuring Visual C++ with Informix include files and library file directories.

Choose File Open and open AddInts.mak, your project makefile, from the AddInts\src\C directory.

Choose Build Set Active Configuration. The Set Active Project Configuration dialog box appears.

Select the Debug version of the project.

Click OK.

Choose Build Build AddInts.bld to compile.

Microsoft Developer Studio creates a Debug subdirectory under the src\C directory to hold debugging dynamic link libraries.


6

Install the AddInts DataBlade module.

To package a DataBlade module for installation on other systems, you typically use BladePack. However, because of the simplicity of the AddInts DataBlade module, you do not use BladePack to create an installation package.

Create the following new directory on the server machine:

    %INFORMIXDIR%\extend\AddInts.1.0

Copy the AddInts.bld file from the src\C\Debug directory and the .sql files from the scripts directory into the AddInts.1.0 directory.

Ensure that the permissions on the AddInts.bld file are read-only. (If your dynamic link library or shared object file is not read-only, a database server error occurs when you try to load it.)


7

Start the database server.

These instructions describe how to start Informix Dynamic Server on Windows NT. For instructions on starting Informix Dynamic Server on UNIX, see the Administrator's Guide for your database server.

From the Control Panel, open the Services application.

Select the INFORMIX-Universal Server service.

Click Start.


8

Create a test database.

If the database in which you plan to test the AddInts DataBlade module does not yet exist, create it using the following SQL statement:

    create database addints_test with buffered log;
    
    

9

Register your DataBlade module in the database.

After you have installed your DataBlade module, you must register it in the database where you plan to use it.

You should be logged on as the default user for your workstation (so that your NT or UNIX login is the same as your Informix user ID).

Start BladeManager from the Informix program group.

In the Databases page of the BladeManager window, select the name of the Informix database in which you want to register your DataBlade module.

From the Available list, select AddInts.1.0 and click Add.

Click Apply to register the DataBlade module in the database.

Click Exit to close BladeManager.

See the DataBlade Module Installation and Registration Guide for information about using BladeManager from the command line.


10

Run your DataBlade module.

After you install and register the DataBlade module, the Informix database accepts the new AddIntegers() function as if it was built-in.

To test AddIntegers(), use SQL Editor or DB-Access to connect to the database where you registered your DataBlade module and execute the following SQL statement:

    execute function AddIntegers(2, 5); 
    
    

The correct result is 7.

Test your DataBlade module with other pairs of numbers to verify that it is functioning correctly.


Please Send Us Your Feedback

How useful was this exercise?

Very useful Somewhat useful Useful Not useful

How would you describe your experience with Informix software?

Very experienced Some experience Novice Complete beginner

How would you like to see this exercise improved? Any other comments?


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