IBM Support

How To Display BLOB Type Data

Question & Answer


Question

How Can I Display Data in BLOB?

Answer

If you have a field that is defined as a BLOB and you run a select statement over the file, the data in the field does not display. You will see *POINTER as the value of the field. In order to view the data in a BLOB field you need a locator. Further information on the locator and samples on how to display the data using a locator see the Redbook below.

DB2 UDB for AS/400 Object Relational Support
http://www.redbooks.ibm.com/redbooks/pdfs/sg245409.pdf

There is a way to manipulate the data and view it in HEX if a quick limited review of the data is needed. Due to the size of BLOB which has a maximum length of 2,147,483,647 (in bytes) not all data can be displayed via a select statement. The maximum amount of data you can display in the statement is 32,765. The following statement can be used to display the maximum amount of data allowed in HEX.

select hex(substr(HOUSE_DESCRIPTION,1, 32765)
from PINTOS1/CUSTOMERRHUS
Note: In the statement above HOUSE_DESCRIPTION is the BLOB field. The output will display hexadecimal values of the maximum length of 32,765.

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CHeAAM","label":"IBM i Db2"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Document Information

More support for:
IBM i

Component:
IBM i Db2

Software version:
All Versions

Operating system(s):
IBM i

Document number:
706807

Modified date:
12 December 2024

UID

nas8N1021088

Manage My Notification Subscriptions