Tutorial exercise 6: Using smart large objects

This exercise demonstrates how to create a DataBlade® module that handles smart large objects. This exercise has nine steps. It takes approximately one hour to complete.

About this task

Smart large objects allow you to store large data files in a way similar to that used by an operating system file system, while controlling, accessing, and altering files with the database server.

A smart large object has two parts:
  • The data file, which is stored in an sbspace
  • The handle, which is stored in the database and contains the location of the data file in the sbspace

For more information about smart large objects, see the Informix® DataBlade API Programmer's Guide.

See the Informix Administrator's Guide for information about creating an sbspace with the onspaces utility.

The example Poem DataBlade module creates one new opaque data type, Poem, and the internal support routines the database server uses to process the Poem data type. The Poem data type contains a single member: a handle to a smart large object. The data for the Poem data type consists of XML files, each containing a poem.