Nonstop Database, HiRDB Version 9 UAP Development Guide
![[Contents]](FIGURE/CONTENT.GIF)
![[Index]](FIGURE/INDEX.GIF)
![[Back]](FIGURE/FRONT.GIF)
4.13.2 Examples of using the addition update and partial extraction facility for BLOB data
(1) Addition update of BLOB data
Multiple files are stored as one BLOB data element.
![[Figure]](FIGURE/ZU041301.GIF)
- Explanation
- The BLOB data of file 1 is inserted in column C2 of row A in the target table (T1).
- The BLOB data of file 2 is added by concatenating the data to column C2 of row A. The same applies when subsequent data is added.
(2) Partial extraction of BLOB data
The BLOB data of file 2 is extracted from the BLOB data (column C2) in row A that was stored in Addition update of BLOB data.
![[Figure]](FIGURE/ZU041302.GIF)
- Explanation
- The SUBSTR scalar function is used to extract data from the starting position (byte (100 x 1024 + 1) = byte 102401) of the data column for file 2. Only the amount of data equivalent to the length of the data column in file 2 (200 x 1024 = 204800 bytes) is extracted.
(3) Rear deletion update of BLOB data
The rear part of the BLOB data (column C2) in row A that was stored in Addition update of BLOB data is deleted and only files 1 and 2 are retained.
![[Figure]](FIGURE/ZU041303.GIF)
- Explanation:
- The SUBSTR scalar function is used to replace data from the start position (byte 1) of the data column for file 1 with as much data as there is in files 1 and 2 (100 x 1024 + 200 x 1024 = 307200 bytes). As a result, only files 1 and 2 remain, and the rear part of the data is deleted.
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.