The following are examples of LOB host variables in ILE RPG.
CLOB example
The following declaration:
D MYCLOB S SQLTYPE(CLOB:1000)
results in the generation of the following structure:
D MYCLOB DS
D MYCLOB_LEN 10U
D MYCLOB_DATA 1000A
DBCLOB example
The following declaration:
D MYDBCLOB S SQLTYPE(DBCLOB:400)
results in the generation of the following structure:
D MYDBCLOB DS
D MYDBCLOB_LEN 10U
D MYDBCLOB_DATA 400G
BLOB example
The following declaration:
D MYBLOB S SQLTYPE(BLOB:500)
results in the generation of the following structure:
D MYBLOB DS
D MYBLOB_LEN 10U
D MYBLOB_DATA 500A
Notes: - For BLOB and CLOB, 1 ≤ lob-length ≤ 65 531
- For DBCLOB, 1≤ lob-length ≤ 16 383
- LOB host variables are allowed to be declared in host structures.
- LOB host variables are not allowed in host structure arrays. LOB locators
should be used instead.
- LOB host variables declared in structure arrays cannot be used as standalone
host variables.
- SQLTYPE, BLOB, CLOB, DBCLOB can be in mixed case.
- SQLTYPE must be between positions 44 to 80.
- When a LOB is declared as a stand-alone host variable, position 24 must
contain the character 'S' and position 25 must be blank.
- The stand-alone field indicator S in position 24 should be omitted when
a LOB is declared in a host structure.
- LOB host variables cannot be initialized.