What's New


Object Relational Features

Abstract or structured data types are type mechanisms for modeling and storing complex objects in a relational database. Structured types may have multiple fields embedded within them, for example, a geometric shape (a list of Cartesian coordinates), or an employee (name, address, gender, birth date, and employee number) can be modeled and stored in DB2 Universal Database.

Structured Types

Structured type support has been extended to provide the ability to create tables with structured type columns. Additionally, structured types can be nested within a structured type. This means that the attributes of a structured type are no longer restricted to the base SQL types, they can now be of another structured type.

In Version 7, you can define functions with input parameters or parameters on the RETURNS clause that are structured types. You can also define methods for each structured data type, which permit the encapsulation of behavior with data. A method is defined very much like a function, but its use is strictly associated with structured types. It is essentially a routine with a structured type instance as its implicit first argument.

The Reorganize Table (REORG) and the db2look utilities can be used on tables with structured type columns. See the Command Reference for more information on REORG and the Administration Guide: Implementation and Administration Guide: Performance for more information on structured types and db2look.

Transform Functions

Transform functions enable the use of structured type columns with user written programs. Transform functions convert the complex structure within a structured data type into an ordered set of its base SQL types. They also convert the base attributes back to their structured types. These transforms are required to move structured types in and out of a database. See the Administration Guide: Implementation for more information.

SQL-bodied Functions

An SQL-bodied function contains expressions or SELECT statements within its body, which is embedded into the calling SQL (similar to a macro). This allows the query compiler to optimize the whole SQL statement including the SQL-bodied function. Structured data types make use of SQL-bodied functions for their transform functions (see Transform Functions) and methods (see Structured Types).

Typed Tables

You can now use referential integrity constraints and triggers with typed tables.


[ Top of Page | Previous Page | Next Page ]