Nonstop Database, HiRDB Version 9 Command Reference

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

8.11.4 UOC interface

Organization of this subsection
(1) Structure and contents of the UOC interface area
(2) Format of data values

(1) Structure and contents of the UOC interface area

An interface area is used to exchange information between pdrorg and a UOC. It is called a UOC interface area.

pdrorg always allocates this area except for the update buffer. The UOC receives the address of this area in the first argument of a call function to reference and update information.

Figure 8-28 Structure of the UOC interface area (1/2) and Figure 8-29 Structure of the UOC interface area (2/2) show the structure of the UOC interface area.

Figure 8-28 Structure of the UOC interface area (1/2)

[Figure]

Note 1
Square brackets [ ] enclose the numeric value for HiRDB in the 64-bit mode.

Note 2
For details about the contents of the UOC interface are, see Table 8-32 Contents of the UOC interface area; for details about the contents of the column definition information address list, see Table 8-33 Contents of column definition information address list; for details about the contents of the column definition information area, see Table 8-34 Contents of column definition information area; for details about the contents of the abstract data-type reverse-creation parameter information area, see Table 8-35 Contents of the abstract data type reverse-creation parameter information area.

Figure 8-29 Structure of the UOC interface area (2/2)

[Figure]

Note 1
Square brackets [ ] enclose the numeric value for a HiRDB in the 64-bit mode.

Note 2
For details about the contents of the data address list, see Table 8-38 Contents of data address list; for details about the contents of the post-update data address list, see Table 8-39 Contents of post-update data address list.

Table 8-32 Contents of the UOC interface area

Relative location Field name Length (bytes) Attribute Program setting the value Description
32 64 32 64
0 0 Eye-catcher 8 8 char pdrorg Interface area ('*UOCINF*')
8 8 Running program 4 4 int pdrorg Program that has control:
0: pdrorg
1: UOC
12 12 Call type 4 4 int pdrorg Type of processing request to the UOC:
o: Start request
e: Data update request
c: Termination request
t: Stop request
16 16 Length of authorization identifier 2 2 short pdrorg Length of the target table's owner name
18 18 Authorization identifier 30 30 char pdrorg Target table's owner name
48 48 Length of table identifier 2 2 short pdrorg Length of the target table name
50 50 Table identifier 30 30 char pdrorg Name of the target table
80 80 Row length 4 8 long pdrorg If the data storage method is Y, this field sets the row length.
84 88 Address of the data address list 4 8 void* pdrorg Start address of the data address list that contains the address of the data retrieved by pdrorg
88 96 Information used by the system 4 8 long pdrorg Information used by the system (UOC may not use this information)
92 104 Address of the post-update data address list 4 8 void* UOC If the data updated by the UOC is to be returned to pdrorg, this field sets the start address of the post-update data address list that contains the address of the data created within the UOC. If the data is not to be updated, this field sets 0.
96 112 Address of user parameter 4 8 void* pdrorg Address of the character string that was specified in the param operand of the unlduoc statement (the character string ends with /0). If the param operand was omitted, the null value is set.
100 120 Address of the column definition information address list 4 8 void* pdrorg Start address of the column definition information address list for the target table
104 128 Reserved 1 1 char pdrorg Reserved area (UOC may not use this information)
105 129 Table attribute 1 1 char pdrorg Attribute of the target table:
F: FIX table
blank: Non-FIX table
106 130 Number of columns 2 2 short pdrorg Number of columns in the target table
108 132 Storage flag 1 1 char UOC Storage flag:
Y: Stores data in unload data file.
N: Does not store data in unload data file.
If pdrorg is used to create an unload data file, make sure that this flag is set (if the UOC is used to create a UOC data file, there is no need to set this flag).
109 133 Data storage method 1 1 char pdrorg For a FIX table, this field sets the value of the fixrow operand specified in the unlduoc statement (when fixrow is omitted, the field sets N).
Y: Passes data in the order the columns were defined (consecutively).
N: Passes the start address of the data that has been corrected according to the boundary of data type.
110 134 Reserved 10 10 char pdrorg Reserved area (UOC may not use this information)
120 144 Return code 4 4 int UOC Return code.
The UOC that has received control from pdrorg must set a return code for each call according to the following guidelines:

0:
Set this code if the processing for each request was executed normally.

4:
Set this code if you want to display a message even when processing was normal, such as for debugging. The meaning is the same as for 0. When the return code is set to 4, the message is displayed up to three times. Note that once the message has been displayed three times, the utility ignores return code 4, if set again, in which case there is no more message display.

8:
Set this code if an error occurs during UOC processing.
If the set return code is none of the above, pdrorg cancels processing. When the return code is 4 or 8, pdrorg outputs the contents of the message-embedded area to the standard output and message log. Make sure that the message consists of no more than 131 bytes of a character string that ends with \0. pdrorg does not output any message that begins with \0.
124 148 Message-embedded area 132 132 char pdrorg
UOC
Storage area for the message that is output to the standard output and message log (pdrorg places \0 at the beginning of the message before passing it).

Legend:
32: Shows the relative location or length for a HiRDB in the 32-bit mode.
64: Shows the relative location or length for a HiRDB in the 64-bit mode.

Note 1
For the start address, pdrorg guarantees a 4-byte boundary for a HiRDB in the 32-bit mode and an 8-byte boundary for a HiRDB in the 64-bit mode.

Note 2
The following table describes whether or not each field can be referenced and updated:
Field name Call type
Start request Data update request Termination request Stop request
Eye-catcher R R R R
Running program R R R R
Call type R R R R
Length of authorization identifier R R R R
Authorization identifier R R R R
Length of table identifier R R R R
Table identifier R R R R
Row length N R N N
Address of the data address list N R N N
Address of the post-update data address list N Y N N
Address of user parameter R R R R
Address of the column definition information address list R R R R
Table attribute R R R R
Number of columns R R R R
Data storage method N Y N N
Message-embedded area Y Y Y Y
Return code Y Y Y Y
Storage flag N Y N N
Legend:
Y: Value can be set.
R: Value can be referenced.
N: Value cannot be referenced (value is not guaranteed).

Table 8-33 Contents of column definition information address list

Relative location Field name Length (bytes) Attribute Program setting the value Description
32 64 32 64
0 0 Definition information address for column ID1 4 8 void* pdrorg Sets the address of the column definition information for column ID1.
4 8 Definition information address for column ID2 4 8 void* pdrorg Sets the address of the column definition information for column ID2.
(n - 1) [Figure] 4 (n - 1) [Figure] 8 Definition information address for column IDn 4 8 void* pdrorg Sets the address of the column definition information for column IDn.

Legend:
32: Shows the relative location or length for a HiRDB in the 32-bit mode.
64: Shows the relative location or length for a HiRDB in the 64-bit mode.

Note 1
For the start address, pdrorg guarantees a 4-byte boundary for a HiRDB in the 32-bit mode and an 8-byte boundary for a HiRDB in the 64-bit mode.

Note 2
The contents of the column definition information address list are passed consecutively in the order of the column definitions.

Table 8-34 Contents of column definition information area

Relative location Field name Length (bytes) Attribute Program setting the value Description
32 64 32 64
0 0 Length of column name 2 2 short pdrorg Sets the length of the column name.
2 2 Column name 30 30 char pdrorg Sets the column name.
32 32 Column ID 2 2 short pdrorg Sets the column ID.
34 34 Reserved 1 1 1 -- -- --
35 35 Data type 1 1 unsigned char pdrorg Sets the data type of the column. For details about the data code and data value boundary for each data type, see Table 8-37 Data code and data value boundary for each data type.
36 36 Defined length 2 2 short pdrorg Sets the defined length of the column. For details about the length and contents of the definition length area for columns, see Table 8-37 Data code and data value boundary for each data type.
38 38 Repetition count 2 2 short pdrorg Sets the repetition count for the column.
40 40 BLOB or BINARY length 8 8 int[2] pdrorg This field is set if the column's data type is large object data or BINARY. The first 4 bytes are set to 0 and the remaining 4 bytes contain the defined length of large object data type in bytes.
48 48 Number of parameter 2 2 short pdrorg For an abstract data type, this field sets the number of functions in the corresponding unld_func statements (number of parameters). A value of 0 is set in the following cases:
  • The column's data type is not an abstract data type.
  • No unld_func statement is specified for the abstract data type.
50 50 Reserved 2 6 6 char pdrorg Reserved area
56 56 Extended address 4 8 void* pdrorg Sets the start address of the abstract data type reverse-creation parameter information. A value of 0 is set if the number of parameters is 0.
60 64 Reserved 3 64 64 char pdrorg Reserved area

Legend:
32: Shows the relative location or length for a HiRDB in the 32-bit mode.
64: Shows the relative location or length for a HiRDB in the 64-bit mode.
--: Not applicable.

Note
For the start address, pdrorg guarantees a 4-byte boundary for a HiRDB in the 32-bit mode and an 8-byte boundary for a HiRDB in the 64-bit mode.

Table 8-35 Contents of the abstract data type reverse-creation parameter information area

Relative location Field name Length (bytes) Attribute Program setting the value Description
0 Parameter number 2 short pdrorg Parameter number (beginning with 1)
2 Data type 1 unsigned char pdrorg Sets the data type of the parameter. For details about the data code and data value boundary for each data type, see Table 8-37 Data code and data value boundary for each data type.
3 Reserved 1 3 char pdrorg Reserved area
6 Defined length 2 short pdrorg Sets the defined length of the parameter. For details about the length and contents of the definition length area for columns, see Table 8-36 Length and contents of the definition length area for columns.
8 BLOB or BINARY length 8 int[2] pdrorg If the parameter's data type is large object data or BINARY, this field sets the BLOB length. The first 4 bytes are set to 0 and the remaining 4 bytes contain the defined length of large object data type in bytes.
16 Reserved 2 112 char pdrorg Reserved area

Note 1
For the start address, pdrorg guarantees a 4-byte boundary for a HiRDB in the 32-bit mode and an 8-byte boundary for a HiRDB in the 64-bit mode.

Note 2
The contents of the abstract data type reverse-creation parameter information area are passed consecutively in the order of functions (parameters) specified in the unld_func statement.

Table 8-36 Length and contents of the definition length area for columns

Data type Area size Description
DECIMAL, LARGE DECIMAL,
INTERVAL YEAR TO DAY, and
INTERVAL HOUR TO SECOND
Leading 1 byte Precision specified in the definition
Trailing 1 byte Unit specified in the definition
TIMESTAMP(p) 2 bytes 7 + [Figure]p/2[Figure]
BLOB, abstract data type, and BINARY 2 bytes Value is not guaranteed
Other 2 bytes Defined length

Table 8-37 Data code and data value boundary for each data type

Data type Data code (hexadecimal) Boundary (in bytes)
NOT NULL constraint omitted NOT NULL constraint specified
MVARCHAR A1 A0 2
MCHAR A5 A4 --
NVARCHAR B1 B0 2
NCHAR B5 B4 --
VARCHAR C1 C0 2
CHAR C5 C4 --
FLOAT E1 E0 8
SMALLFLT E3 E2 4
DECIMAL E5 E4 --
INTEGER F1 F0 4
SMALLINT F5 F4 2
INTERVAL YEAR TO DAY 65 64 --
DATE 71 70 --
TIME 79 78 --
INTERVAL HOUR TO SECOND 6F 6E --
TIMESTAMP 7D 7C --
BINARY 91 90 4
BLOB 93 92 4
Abstract data type Address list of abstract data type parameter 83 82 4 for a HiRDB in the 32-bit mode and 8 for a HiRDB in the 64-bit mode
Data for parameter Depends on the data type of the parameter

Legend:
--: Address boundary is not adjusted.

Table 8-38 Contents of data address list

Relative location Field name Length (bytes) Attribute Program setting the value Description
32 64 32 64
0 0 Data storage address for column ID1 4 8 void* pdrorg Sets the address of the data for column ID1.
4 8 Data storage address for column ID2 4 8 void* pdrorg Sets the address of the data for column ID2.
(n - 1) [Figure] 4 (n - 1) [Figure] 8 Data storage address for column IDn 4 8 void* pdrorg Sets the address of the data for column IDn.

Legend:
32: Shows the relative location or length for a HiRDB in the 32-bit mode.
64: Shows the relative location or length for a HiRDB in the 64-bit mode.

Note 1
For the start address, pdrorg guarantees a 4-byte boundary for a HiRDB in the 32-bit mode and an 8-byte boundary for a HiRDB in the 64-bit mode.

Note 2
The contents of the data address list are passed consecutively in the order defined.

Note 3
If the column value is null, 0 is set.

Note 4
In the case of a FIX table, if the data storage method is Y in the UOC interface area, the data buffer stores a contiguous area equivalent to the row length of the UOC information beginning at the address indicated by the data storage address for column ID1. Data is stored in the order of column IDs.

Note 5
If the data storage method is N in the UOC interface area, the start address of the data is adjusted at the specified boundary for each data type. Data is not consecutive for each column.

Note 6
If the number of parameters in the column definition information area is 0, a value of 0 is set.

Table 8-39 Contents of post-update data address list

Relative location Field name Length (bytes) Attribute Program setting the value Description
32 64 32 64
0 0 Data storage address for column ID1 4 8 void* UOC Sets the address of the data for column ID1.
4 8 Data storage address for column ID2 4 8 void* UOC Sets the address of the data for column ID2.
(n - 1) [Figure] 4 (n - 1) [Figure] 8 Data storage address for column IDn 4 8 void* UOC Sets the address of the data for column IDn.

Legend:
32: Shows the relative location or length for a HiRDB in the 32-bit mode.
64: Shows the relative location or length for a HiRDB in the 64-bit mode.

Note 1
For the start address, guarantee a 4-byte boundary for a HiRDB in the 32-bit mode and a 8-byte boundary for a HiRDB in the 64-bit mode.

Note 2
After data has been updated, set the data address list in consecutive areas in the order of column definitions.

Note 3
You may set the data storage address contained in the data address list as the data address value. Make sure that the data value is not updated.

Note 4
There is no need to guarantee the boundary for the data address.

Note 5
Set 0 if you are changing to null the value of a column for which the NOT NULL constraint was not specified in the column definition. The following table describes whether or not data can be changed, depending on the NOT NULL constraint specification.
Column attribute Data before updating Data after updating
Non-null value Null value
NOT NULL constraint omitted Null value Y Y
Non-null value Y Y
NOT NULL constraint specified Non-null value Y N
Legend:
Y: Can be changed.
N: Cannot be changed.

Note 6
In the case of a FIX table for which reserved columns are defined, updating the values of the reserved columns has no effect on the unload files. If you want to store data in the reserved columns and then unload the table, use a UOC to output the files. For details about using a UOC to output files, see 8.9.4 unload statement (specification of unload data file).

(2) Format of data values

This section explains the data values of each data type.

(a) INTEGER or SMALLINT
(b) FLOAT or SMALLFLT
(c) DECIMAL

[Figure]

(d) CHAR, MCHAR, VARCHAR, or MVARCHAR

The following figure shows the format when character code conversion is not performed or when character code conversion that does not affect the data lengths is performed.

[Figure]

(e) CHAR or VARCHAR

The following figure shows the format when data lengths are changed by character code conversion.

[Figure]

(f) NCHAR or NVARCHAR

[Figure]

(g) DATE

[Figure]

(h) TIME

[Figure]

(i) INTERVAL YEAR TO DAY

[Figure]

(j) INTERVAL HOUR TO SECOND

[Figure]

(k) TIMESTAMP

[Figure]

(l) BINARY

[Figure]

(m) BLOB

[Figure]

(n) Abstract data type

For an abstract data type, the address list of an abstract data-type parameter is stored. Figure 8-30 Structure of the address list for an abstract data-type parameter shows the structure of the address list for an abstract data-type parameter, and Table 8-40 Contents of the address list for an abstract data-type parameter describes the contents of the address list for an abstract data-type parameter.

Figure 8-30 Structure of the address list for an abstract data-type parameter

[Figure]

Note
Square brackets [ ] enclose the numeric value for HiRDB in 64-bit mode.

Table 8-40 Contents of the address list for an abstract data-type parameter

Relative location Field name Length (bytes) Attribute Program setting the value Description
32 64 32 64
0 0 Data address for parameter 1 4 8 void* pdrorg Sets the address of the data for parameter 1.
4 8 Data address for parameter 2 4 8 void* pdrorg Sets the address of the data for parameter 2.
(n - 1) [Figure] 4 (n - 1) [Figure] 8 Data address for parameter n 4 8 void* pdrorg Sets the address of the data for parameter n.

Legend:
32: Shows the relative location or length for a HiRDB in the 32-bit mode.
64: Shows the relative location or length for a HiRDB in the 64-bit mode.

Note 1
For the start address, pdrorg guarantees a 4-byte boundary for a HiRDB in the 32-bit mode and an 8-byte boundary for a HiRDB in the 64-bit mode.

Note 2
The start address of the parameter data is adjusted by the boundary set for each data type.

Note 3
The contents of the address list for an abstract data-type parameter are passed consecutively in the order of functions (parameters) specified in the unld_func statement.
(o) Repetition columns

[Figure]