DB2- User Defined Data Type

User defined data types like user define functions are creating customised data types.

For example, CREATE DISTINCT TYPE AUDIO AS BLOB(1M);

So now the “audio” becomes a new data-type.

If we talk about user defined data types, there are 2 types.

Distinct type:In this case only user defined type is customised based on existing type

Structured type: 

CREATE TYPE PERSON_DET AS (NAME CHAR(20),

AGE INT,

ADDRESS ADDRESS_T,

INSTANTIABLE

REF USING VARCAHR(13) FOR BIT DATA

MODE DB2 SQL;

The basic difference is , we can create a structure with mix of db2 existing types and UDTs.

The usage for UDTs we can see in the Banking domain.

In my next posts I will add more explanation.

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.