LOB locators in ILE RPG applications that use SQL
BLOB, CLOB, and DBCLOB locators have similar syntax. Here is an example of a BLOB locator.
Example: BLOB locator
- The following declaration in free-form:
DCL-S MYBLOB SQLTYPE(BLOB_LOCATOR);
results in the following generation:
DCL-S MYBLOB UNS(10);
- The following declaration in fixed-form:
D MYBLOB S SQLTYPE(BLOB_LOCATOR)
results in the following generation:
D MYBLOB S 10U
Notes:
- LOB locators are allowed to be declared in host structures.
- SQLTYPE, BLOB_LOCATOR, CLOB_LOCATOR, DBCLOB_LOCATOR can be in mixed case.
- SQLTYPE must be between positions 44 to 80 for fixed-form declarations.
- When a LOB locator is declared as a standalone host variable, position 24 must contain the character 'S' and position 25 must be blank for fixed-form declarations.
- The standalone field indicator S in position 24 for fixed-form declarations should be omitted when a LOB locator is declared in a host structure.
- LOB locators cannot be initialized.