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:
  1. LOB locators are allowed to be declared in host structures.
  2. SQLTYPE, BLOB_LOCATOR, CLOB_LOCATOR, DBCLOB_LOCATOR can be in mixed case.
  3. SQLTYPE must be between positions 44 to 80 for fixed-form declarations.
  4. 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.
  5. 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.
  6. LOB locators cannot be initialized.