INFORMIX DataBlade Developers Kit Tutorial

List of Exercises

Exercise 7: Using Smart Large Objects, Continued


6

Compile the source code with a C compiler.

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

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


7

Install the Poem DataBlade module.

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

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

Ensure that the permissions on the Poem.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.)


8

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.


9

Create a test database.

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

    create database smartlotest with buffered log; 
    
    

10

Register the Poem DataBlade module in the smartlotest database.

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

If registration fails, see " Registration Failure with an sbspace Test" for instructions.

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


11

Run the Poem DataBlade module.

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

When you select smart large objects from the database, the database server copies them to the current directory for your SQL query application (SQL Editor or DB-Access). The current directory depends on how the application is started:

  • If you start the application from the Informix program group, the current directory is the %INFORMIXDIR%\bin directory.
  • If you start the application by double-clicking an SQL file, the current directory is the location of that SQL file.

Copy the following files from the %INFORMIXDIR%\dbdk\InfoShelf\tutorial\source directory to the Poem DataBlade module project directory:

  • dorado.xml
  • forannie.xml
  • annabel.xml
  • poem.sql

Double-click the poem.sql file to open SQL Editor or DB-Access.

To test the Poem DataBlade module

    1. Create the table.

    2. Edit the SQL INSERT statements to reflect the directory to which you copied the XML files.

    3. Insert three smart large objects into the database.

    4. Retrieve the smart large objects; the database server copies them to the same directory as the original files but gives them different names.

    5. Look at the retrieved XML files (named Annabel Lee.xml, Eldorado.xml, and For Annie.xml) using Notepad.


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.