Image, video, and audio objects are represented in the database as BLOBs. A user-defined type (UDT), also known as a distinct type, provides a way to differentiate one BLOB from another. For example, a UDT can be created for image objects and another for audio objects. Though stored as BLOBs, the image and audio objects are treated as types distinct from BLOBs and distinct from each other.
You create UDTs with an SQL CREATE DISTINCT TYPE statement. For example, suppose you are developing an application that processes geographic features on maps. You can create a distinct type named map for map objects as follows:
CREATE DISTINCT TYPE map AS BLOB (1M)
The map-type object is represented internally as a BLOB of 1 megabyte in length, but is treated as a distinct type of object.
You can use UDTs like SQL built-in types to describe the data stored in columns of tables. In the following example, a table is created with a column designed to hold map-type data:
CREATE TABLE places (locid INTEGER NOT NULL, location CHAR (50), grid map)
Each DB2 extender creates a UDT for its type, that is, image, audio, and video.