Home | Previous Page | Next Page   Using Existing Dynamic Server Features > Database Support >

Object-Relational Databases

Object-relational database management systems (ORDBMS) combine relational and object-oriented capabilities. Choose an object-relational database if you need greater flexibility in the types of data that the database server can store and manipulate. An example of an object-relational database is an online store catalog.

You can extend the capability of the database server by defining new data types and user-defined routines (UDRs) that let you store, access, and manage images, audio, video, large text documents, and so on.

An object-relational database supports the following data types and extensibility:

For information about object-relational databases, see the IBM Informix Database Design and Implementation Guide and IBM Informix Guide to SQL: Syntax. For more information about extending the database server, see IBM Informix User-Defined Routines and Data Types Developer's Guide and J/Foundation Developer's Guide.

Simple and Smart Large Objects

The database server supports simple large objects and smart large objects for storing large chunks of binary or text data in a database. A large object is a data object that is logically stored in a table column but physically stored independently of the column. Large objects are stored separately from the table because they typically store very large amounts of data.

For more information on simple and smart large objects, see the IBM Informix Guide to SQL: Reference and IBM Informix Guide to SQL: Tutorial.

Simple Large Objects (TEXT and BYTE Data Types)

The database server stores simple large objects in a dbspace or blobspace. Simple large objects do not support random access to the data. When you transfer a simple large object between a client application and the database server, you must transfer the entire BYTE or TEXT value.

Smart Large Objects (CLOB and BLOB Data Types)

You can use smart large objects to store user-defined types such as video and audio clips, pictures, large text documents, and spatial objects such as drawings and maps.

The database server stores smart large objects in sbspaces. You can control the logging characteristics of smart large objects and sbspaces independently from the logging characteristics of the database. Use a temporary sbspace to store temporary smart large objects without any logging.

Programmers can use functions similar to UNIX and Windows functions to read, write, and seek smart large objects. Dynamic Server provides the smart-large-object API in the DataBlade API and the ESQL/C programming interface.

For information on sbspaces, see the IBM Informix Administrator's Guide. For information on how to create an sbspace, see the discussion of onspaces in the IBM Informix Administrator's Reference. For information on how to calculate space and tune sbspaces, see your IBM Informix Performance Guide. For information on how to access a simple large object or a smart large object from a client application, see the IBM Informix ESQL/C Programmer's Manual. For information on using the DataBlade API with smart large objects, see the IBM Informix DataBlade API Programmer's Guide.

User-Defined Data Types

You can create user-defined data types (UDTs) to extend the database server and provide greater flexibility in the types of data that you can store and manipulate. User-defined data types can be opaque or distinct.

You create a distinct data type with the CREATE DISTINCT TYPE statement. A distinct type has the same internal structure as an existing data type. However, it has a distinct name and therefore distinct functions that make it different from its source type. Once you create the distinct type, you can use it anywhere that other data types are valid.

You create and register an opaque data type with the CREATE OPAQUE TYPE statement. An opaque type stores a single value and cannot be divided into components by the database server. It is implemented as a structure and a set of routines that allow the database server to support the data type.

Complex Data Types

A complex data type is a composite of existing data types. It can be a named row type, unnamed row type, or collection type. For example, you might create a complex type whose components include built-in types, opaque types, distinct types, or other complex types.

A collection type is a group of elements of the same data type. Collection data types let you store and manipulate collections of data within a single row of a table.

A row type is a sequence of one or more fields. Each field has a name and a data type. The fields of a row are comparable to the columns of a table, but there are important differences. You cannot define a default value for a field, you cannot define constraints on a field, and you cannot use fields with tables, only with row types. Row types can be named or unnamed:

User-Defined Routines

A routine is a collection of program statements that perform a particular task. A user-defined routine (UDR) is a routine that you can define and that can be invoked within an SQL statement or within another UDR. A UDR can either return values or not, as follows:

The database server supports UDRs written in the following languages:

For information on implementing user-defined routines, see IBM Informix User-Defined Routines and Data Types Developer's Guide.

Operator Functions

An operator function is an SQL-invoked function that has a corresponding operator symbol (such as '=' or '+'). These operator symbols are used within expressions in an SQL statement.

The database server provides operator functions for most built-in data types. You can extend an existing operator to operate on a user-defined data type.

For information on extended operations, see IBM Informix User-Defined Routines and Data Types Developer's Guide.

User-Defined Casts

A cast performs a conversion between two data types. The database server provides casts between the built-in data types. For example, when you add an integer value to a decimal value, the database server performs a cast to change the integer into a decimal so that it can perform the addition.

You can write user-defined cast functions to convert between an existing data type and an extended data type that you create.

For information on implementing user-defined casts, see IBM Informix User-Defined Routines and Data Types Developer's Guide.

Inheritance

Inheritance lets you define objects (types and tables) that acquire the properties of other objects and add new properties that are specific to the object that you define.

User-Defined Aggregates

Use a user-defined aggregate (UDA) to perform any kind of aggregate computation on a column, such as the average or the count. You can either create a user-defined aggregate or extend an existing aggregate for extended data types.

For the SQL syntax to create and drop UDAs, see the IBM Informix Guide to SQL: Syntax. For information on using UDAs, see IBM Informix User-Defined Routines and Data Types Developer's Guide.

User-Defined Virtual Processors

You can designate a user-defined virtual processor to run DataBlade modules or UDRs written in the C language. Designate a Java virtual processor to run UDRs written in the Java language.

For information on virtual processors, see the IBM Informix Administrator's Guide and IBM Informix User-Defined Routines and Data Types Developer's Guide.

DataBlade Modules

IBM and other vendors package some data types and their access methods into DataBlade modules (shared class libraries) that you can add to the database server to store and access nontraditional data types such as two-dimensional spatial objects (lines, polygons, ellipses, and circles), 3D images, sound, video, electronic documents, HTML pages, and time-series data. A DataBlade module might also provide new types of access to large text documents, including phrase matching, fuzzy searches, and synonym matching.

You can do the following:

For information on how to work with and create your own DataBlade modules, see the IBM Informix DataBlade API Programmer's Guide, the IBM Informix DataBlade API Function Reference, and the IBM Informix DataBlade Developer's Kit User's Guide.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]