Working with structured types

In an object-oriented design, we have business objects as entities and each entity has a set of attributes. A structured type is a user-defined special data type, consisting of one or more data types. To represent an entity in DB2, we can use structured types.

A structured type is a user-defined data type consisting of one or more data types defined as its attributes. For example, in a school, a room can be one entity and its attributes can be length, width, and height. In this example, we can create a structured type as room and define its attributes as width, height, and length. Once we have created a structured type, we can use it as a regular built-in data type. DB2 also provides ways to define its behavior. In ...

Get IBM DB2 9.7 Advanced Application Developer Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.