This example loads table T1's unload data to table T2, where T1 has SGMLTEXT columns including BLOB parameter data and T2 has BLOB columns. The table definitions show only the row name and data type specification sections; the other sections are omitted.
(a) Order of column definitions do not match between T1 and T2
- Table definition during unloading:
T1(C1 INT, C2 SGMLTEXT, C3 BLOB)
- Table definition during data loading:
T2(C4 BLOB ,C5 INT, C6 SGMLTEXT)
- Contents of column structure information file:
C5
C6, func = (SGMLTEXT, param = blob)
C4
(b) T2 has more columns than T1
- Table definition during unloading:
T1(C1 INT, C2 SGMLTEXT, C3 BLOB)
- Table definition during data loading:
T2(C4 INT ,C5 BLOB)
- Contents of column structure information file:
C4
*skipdata*, type = blobprm
C5
(c) T2 has more columns than T1
- Table definition during unloading:
T1(C1 INT, C2 BLOB)
- Table definition during data loading:
T2(C4 INT, C5 BLOB, C6 SGMLTEXT)
- Contents of column structure information file:
C4
C5
(d) Replacing column data
This example replaces LOB attribute data (C2) in T1's SGMLTEXT type column to T2's LOB column (C6) and T1's LOB column data (C3) to the LOB attribute (C5) of the SGMLTEXT type column in T2.
- Table definition during unloading:
T1(C1 INT, C2 SGMLTEXT, C3 BLOB)
- Table definition during data loading:
T2(C4 INT ,C5 SGMLTEXT, C6 BLOB)
- Contents of column structure information file:
C4
C6, type=blobprm
C5, func=(sgmltext, param=blob)
(e) Changing the data type of columns
This example loads the LOB attribute data (C2) from an SGMLTEXT type column to the BINARY attribute (C5) of an SGMLBIN type column and loads data (C3) from a LOB column to a BINARY type column (C6).
- Table definition during unloading:
T1(C1 INT, C2 SGMLTEXT, C3 BLOB)
- Table definition during data loading:
T2(C4 INT ,C5 SGMLBIN, C6 BINARY)
- Contents of column structure information file:
C4 ................................................1
C5, func=(sgmlbin, param=binary, type=blobprm) ....2
C6, type=blob .....................................3
Explanation
- Stores T1's C1 data to T2's C4. Specification of data type is omitted because C1 and C4 have the same data type.
- Stores T1's C2 data to T2's C5. To store data in the abstract data type column SGMLBIN provided by the plug-in, this example uses the func option to specify the constructor function sgmlbin and the attribute data type binary. Because the input data has the LOB attribute of the abstract data type column SGMLTEXT provided by the plug-in, the example uses the type operand to specify the LOB attribute (blobprm).
- Stores T1's C3 data in T2's C6. Because C3 and C6 have different data types, this example specifies the data type of the input data (blob) in the type operand.
(f) Area required for data conversion
If data conversion results in BLOB data placed between the BINARY type data, BINARY parameter data of abstract data type, and BLOB parameter data of an abstract data type, you need to allocate memory to retain that BLOB data. If the utility is unable to allocate this memory, it terminates with a memory allocation error. Memory allocation is required in the following cases:
- When BLOB data is loaded to an abstract data type column with BLOB attribute, the data may be loaded to another BLOB type column before that BLOB data.
- When BLOB parameter data of an abstract data type is loaded to a BLOB type column, the data may be loaded to an abstract data type column with BLOB attribute after that BLOB parameter data of the abstract data type.
- When BLOB data or BLOB parameter data of an abstract data type is loaded to a BINARY type column or an abstract data type column with BINARY attribute, the data may be loaded to another BLOB type column before the target BLOB data or BLOB parameter data of the abstract data type.
Figure 5-24 shows the data arrangement in the input data file in the pdrorg-created binary format that is output from a table for which BINARY type columns, abstract data type columns with BLOB attribute, and BLOB type columns are defined.
Figure 5-24 Data arrangement in an input data file in the pdrorg-created binary format
![[Figure]](figure/zu050810.gif)
- Explanation
- pdload allocates an input data area of at least M. The maximum size of M is determined from the target table definition (you can also specify a desired size in the macreclen operand of the source statement).
- If data is loaded in this arrangement, pdload processes the data sequentially and does not allocate any more area for input data.
- If data conversion is specified in the column structure information file, pdload allocates an area of M + M2 + K. As the input data area, pdload allocates an area of M + M2 and to retain the BLOB data section preceding the data converted to the BINARY type, pdload allocates an area of K. You can specify the size of the K area using the bloblimit operand in the option statement. pdload allocates the area whose size is obtained from the target table definition or the option statement's bloblimit operand, whichever is smaller.