INFORMIX DataBlade Developers Kit Tutorial

List of Exercises

Exercise 5: Creating Opaque Data Types, continued


8

Compile the source code with a C compiler.

See " Compiling and Linking DataBlade Module Code" for detailed instructions on using the Visual C++ makefile (Circle.mak for this exercise) to compile the source code into the dynamic link library file (Circle.bld).

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


9

Install the Circle DataBlade module.

Install the Circle DataBlade module into the %INFORMIXDIR%\extend\Circle.1.0 directory on the server machine.

See " Installing a DataBlade Module" for detailed installation instructions.

Ensure that the permissions on the Circle.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 run it.)


10

Start the database server.

See " Starting Informix Dynamic Server on Windows NT" for detailed instructions for starting Informix Dynamic Server on Windows NT.

For instructions on starting Informix Dynamic Server on UNIX, see the Administrator's Guide for your database server.


11

Create a test database.

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

    create database opaquetest with buffered log; 
    
    

12

Register the Circle DataBlade module in the opaquetest database.

See " Registering a DataBlade Module" for detailed instructions on registering using the BladeManager graphical user interface.

For information on registering using BladeManager from the command line, see the DataBlade Module Installation and Registration Guide.


13

Run the Circle DataBlade module.

After you install and register the Circle DataBlade module, the Informix database server accepts the new data types and routines and runs them as if they were built-in.

To test the Circle DataBlade module, execute these SQL operations using DB-Access or SQL Editor

    1. Create a table tst_Pnt that contains a Pnt column.

    2. Insert sample data into tst_Pnt.

    3. Run a SELECT statement that calculates the distance of a point from the origin (0, 0) for each record.

    4. Create a table tst_Circ that contains a Circ column.

    5. Insert sample data into tst_Circ.

    6. Run a SELECT statement that calculates if a circle contains the origin (0, 0) for each record.


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.