Scalable Database Server, HiRDB Version 8 Description

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

6.8.12 BLOB and BINARY data addition update and partial extraction facility

Organization of this subsection
(1) Overview of BLOB and BINARY data addition update and partial extraction facility
(2) Usage examples of the BLOB and BINARY data addition update and partial extraction facility

(1) Overview of BLOB and BINARY data addition update and partial extraction facility

When BLOB or BINARY data is updated after new data has been added to a registered BLOB or BINARY data item, or when an entire BLOB or BINARY data item is retrieved as the result of BLOB or BINARY data being searched, both the server and the client must allocate a large amount of memory for the BLOB or BINARY data, putting a strain on memory resources.

Use of the BLOB and BINARY data addition update and partial extraction facility allows you to avoid straining memory resources, because it allocates only the memory required for the actual amount of BLOB or BINARY data being added or extracted.

However, for BINARY data, the definition length must be 32,001 bytes or greater.

BLOB or BINARY data addition update:
By specifying a concatenation operation in the SET clause of the UPDATE statement, you can add new data to BLOB or BINARY data that has been registered.

BLOB and BINARY data partial extraction
By specifying the SUBSTR scalar function, you can extract only a specified portion of the BLOB or BINARY data.

For details about the BLOB and BINARY data addition update and partial extraction facility, see the HiRDB Version 8 UAP Development Guide.

(2) Usage examples of the BLOB and BINARY data addition update and partial extraction facility

(a) BLOB data addition update

A single BLOB data item is stored across a number of files. Figure 6-18 shows an example of BLOB data addition updating.

Figure 6-18 Example of BLOB data addition updating

[Figure]

Explanation
  1. BLOB data from file 1 is inserted into column C2 of row A in table T1.
  2. Addition updating is performed by concatenating BLOB data of file 2 to column 2 of row A. Subsequent data additions are also performed in a similar manner.
(b) BLOB data partial extraction

An area in file 2 is extracted from the BLOB data in column C2 of row A that was stored using BLOB data addition updating. Figure 6-19 shows an example of BLOB data partial extraction.

Figure 6-19 Example of BLOB data partial extraction

[Figure]

Explanation
Using the SUBSTR scalar function, from column 2 of row A, the length of the data from the data column of file 2 (200 [Figure] 1024 = 204800 bytes) is extracted beginning at the start position of the data column of file 2 (at the 100 [Figure] 1024 + 1 = 102401 byte position).