HiRDB Datareplicator Version 8 Description, User's Guide and Operator's Guide

[Contents][Glossary][Index][Back][Next]

8.1.5 Handling of abstract data types by an import information editing UOC routine

If abstract data types are passed to an import information editing UOC routine, the input data for constructor functions of the abstract data type is passed as attribute data of the abstract data type.

Because attribute data of the abstract data type contains information that is specific to the abstract data type, an import information editing UOC routine must import it to the constructor functions of the abstract data type as is (update data of the abstract data type cannot be edited or processed before it is imported).

Organization of this subsection
(1) Abstract data type mnemonics and the structure of column data
(2) Notes about handling abstract data types
(3) Sample import information editing UOC routine that handles abstract data types

(1) Abstract data type mnemonics and the structure of column data

This subsection explains the abstract data type mnemonics and the structure of column data.

(a) Abstract data type mnemonics

Table 8-16 Column data type mnemonics (UCOLUMN_BLK.coltype) and Table 8-17 Data address mnemonics (UCOLUMN_BLK.dataptr) show the abstract data type mnemonics. For details about the non-abstract data type mnemonics, see Table 8-10 Column data type mnemonics and Table 8-11 Data address mnemonics.

Table 8-16 Column data type mnemonics (UCOLUMN_BLK.coltype) (UCOLUMN_BLK.coltype)

Column data type Mnemonic Data code
ADT (abstract data type) HDS_T_ADT (0x83)

Table 8-17 Data address mnemonics (UCOLUMN_BLK.dataptr)

Data type Mnemonic Address type
ADT (abstract data type) HDS_A_ADT UTYPE_BLK *
(b) Structure of abstract data-type column data

The figure below shows the structure of abstract data-type column data. For details about the structure of non-abstract data-type column data, see Figure 8-4 UDATA_BLK and related structures.

Figure 8-5 Structure of abstract data-type column data

[Figure]

#1
For the contents of UDATA_BLK, see Table 8-7 Contents of UDATA_BLK.

#2
For the contents of UCOLUMN_BLK, see Table 8-8 Contents of UCOLUMN_BLK.

The following table shows the contents of UTYPE_BLK (abstract data type information).

Table 8-18 Contents of UTYPE_BLK (abstract data type information)

Member name Length (bytes) Attribute Area name Defined by Description
schema_name 31 char Authorization identifier Caller Authorization identifier for the abstract data type (including the termination symbol)
type_name 31 char Abstract data type name Caller Type name of the abstract data type (including the termination symbol)
reserve1 2 char Reserved area 1 Caller Reserved
def_attrnum 4 int Number of defined attributes Caller Number of attributes defined for the abstract data type
set_attrnum 4 int Number of attribute data items Caller Number of attribute data items stored in the data type
data_addr 4 UATTR_BLK * UATTR_BLK * address Caller Address of the attribute management table (UATTR_BLK)
reserve2 8 char Reserved area 2 Caller Reserved

The following table shows the contents of UATTR_BLK (attribute data information).

Table 8-19 Contents of UATTR_BLK (attribute data information)

Member name Length (bytes) Attribute Area name Defined by Description
attr_name 31 char Attribute name Caller Attribute name (including the termination symbol)
attr_type 1 unsignedchar Data type of the attribute Caller Data type of the attribute
For details about the data type mnemonics, see Table 8-10 Column data type mnemonics.
null_flag 1 unsignedchar NULL flag for the attribute Caller NULL flag for the attribute
  • 0x01: NULL value
  • 0x00: Non-NULL value
adtfunc 1 unsignedchar Import method for the abstract data type Caller Import method for the abstract data type
  • 0x01: Constructor function import method
  • 0x00: The data type of the attribute is not the abstract data type (0x83)
reserve1 3 char Reserved area 1 Caller Reserved
attr_len 4 int Attribute data length Caller Attribute data length
The value is 0 in the following cases:
  • The data type of the attribute is the abstract data type
  • The NULL flag of the attribute is the NULL value
adtelnum 4 int Abstract data type inheritance count Caller Number of data types with an inheritance relationship when the data type of the attribute is the abstract data type
  • 1: No inheritance
  • 0: The data type of the attribute is not the abstract data type (0x83)
data_addr 4 UNION * Attribute data address Caller Attribute data address (input data for constructor function of the abstract data type that is entered at the source)
  • UTYPE_BLK address: The data type of the attribute is the abstract data type
  • NULL: The NULL flag of the attribute is the NULL value
For details about the data address mnemonics, see Table 8-11 Data address mnemonics.
reserve2 8 char Reserved area 2 Caller Reserved
(c) Settings for UTYPE_BLK and UATTR_BLK of each abstract data type

Table 8-20 Settings for UTYPE_BLK for each abstract data type shows the settings for UTYPE_BLK for each abstract data type, and Table 8-21 Settings for UATTR_BLK for each abstract data type shows the settings for UATTR_BLK for each abstract data type.

Table 8-20 Settings for UTYPE_BLK for each abstract data type

Member name Abstract data type
SGMLTEXT FREEWORD XML
schema_name MASTER MASTER MASTER
type_name SGMLTEXT FREEWORD XML
reserve1 Reserved Reserved Reserved
def_attrnum 0 0 0
set_attrnum 1 1 1
data_addr UATTR_BLK address UATTR_BLK address UATTR_BLK address
reserve2 Reserved Reserved Reserved

Table 8-21 Settings for UATTR_BLK for each abstract data type

Member name Abstract data type
SGMLTEXT FREEWORD XML
attr_name Not specified. Not specified. Not specified.
attr_type HDS_T_BLOB(0x93)# HDS_T_VCHAR(0xC1)# HDS_T_BINARY(0x91)#
null_flag 0x00 0x00 0x00
adtfunc 0x00 0x00 0x00
reserve1 Reserved Reserved Reserved
attr_len Actual attribute data length
(maximum 2,147,483,647)
Actual attribute data length
(maximum 32,000)
Actual attribute data length
(maximum 2,147,483,647)
adtelnum 0 0 0
data_addr Attribute data address Attribute data address Attribute data address
reserve2 Reserved Reserved Reserved

#
To reference attribute data of the abstract data type that has been passed to an import information editing UOC routine, use a cast in C language in the same manner as for the normal column data types. If you will be casting the data structure indicated by the attribute data address to the attribute data type, see Table 8-15 Relationships among the UOC routine's column data type, data length, and representation in C language.

(2) Notes about handling abstract data types

For abstract data types, no value is set in the collen member (column data length) of UCOLUMN_BLK that is passed to an import information editing UOC routine. For this reason, when abstract data types are handled, you must not reference the collen member of UCOLUMN_BLK.

(3) Sample import information editing UOC routine that handles abstract data types

Configuration of the source and target tables
The figure below shows the structure of the sample table that is subject to extraction processing. The sample target table has the same structure.
[Figure]

Example code
The following figure shows an example of coding that executes INSERT on the table that contains columns of the SGMLTEXT, FREEWORD, and XML types.

Figure 8-6 Example of coding that executes INSERT on the table that contains columns of the abstract data types.

[Figure]
[Figure]