![]() |
|
|
SQL Reference | Describes SQL syntax, semantics, and the rules of the language. Chapters 2, 3 and 6 contain details about user-defined types and large objects. | |
Embedded SQL Programming Guide | Explains how to develop applications that access DB2 databases using embedded SQL. Chapter 6 contains details about user-defined types and large objects. | |
CLI Guide and Reference | Explains how to develop applications that access DB2 databases using the DB2 Call Level Interface. Chapter 3 contains details about user-defined types and large objects. | |
Administration Guide | Contains information required to design, implement, and maintain a database. Chapter 4 contains details about user-defined types and large objects. | |
|
|
![]() |
|
|
|
|
|
Embedded SQL
| DB2 CLI |
| |
lobeval | X |
| Demonstrates the use of LOB locators, and deferring the evaluation of the actual LOB data. | |
lobfile | X |
| Demonstrates the use of LOB handles. | |
lobloc | X |
| Demonstrates the use of LOB locators. | |
lobval | X |
| Demonstrates the use of LOBs. | |
showpic.c |
| X | Extracts a binary large object (BLOB) picture to file using SQLBindColToFile() then displays it using xwud on XWindows, iconedit on OS/2. | |
showpic2.c |
| X | Extracts a BLOB picture to a file using piecewise output then displays it using xwud on XWindows, iconedit on OS/2. | |
picin.c |
| X | Loads graphic BLOBs into the emp_photo sample table directly from a file using SQLBindParamToFile(). | |
picin2.c |
| X | Loads graphic BLOBs into the emp_photo sample table using SQLPutData. | |
|
|
|
|
Every data element in the database is stored in a column of a table, and each column is defined to have a data type. The data type places limits on the types of values you can put into the column and the operations you can perform on them. For example, a column of integers can only contain numbers within a fixed range. DB2 includes a set of built-in data types with defined characteristics and behaviors: character strings, numerics, datetime values, and large objects.
Sometimes, however, the built-in data types might not serve the needs of your applications. DB2 provides user-defined types (UDTs) which enable you to define the distinct data types you need for your applications.
UDTs are based on the built-in data types. When you define a UDT, you also define the operations that are valid for the UDT. For example, you might define a MONEY data type that is based on the DECIMAL data type. However, for the MONEY data type, you might allow only addition and subtraction operations, but not multiplication and division operations.
Large objects (LOBs) enable you to store and manipulate large, complex data objects in the database; objects such as audio, video, images, and large documents. UDTs are often based on LOBs.
The combination of UDTs and LOBs gives you considerable power. You are no longer restricted to using the built-in data types provided by DB2 to model your business data, and to capture the semantics of that data. You can use UDTs to define large, complex data structures for advanced applications.
In addition to extending built-in data types, UDTs provide several other benefits: