XML SQL Type

Note: OpenESQL and DB2 ECM only

OpenESQL and DB2 ECM

Syntax
SQL [TYPE] [IS] XML AS CLOB(lob-length)

Where lob-length is a value between 1 and 2147483647 expressed either as a number or a number followed by K (kilobytes), M (megabytes), or G (gigabytes).

Note: Although this SQL TYPE has a theoretical size limitation of 2G, for all practical purposes, the actual limitation is approximately 450M, which is the data size actually allocated to the application program.
Example
01 xmlclob1-hv-name SQL TYPE IS XML AS CLOB(2M).

generates

01 xmlclob1-hv-name.
  03 xmlclob1-hv-name-length  PIC S9(9) COMP-5.
  03 xmlclob1-hv-name-data    PIC X(2097152).

DB2 ECM

Syntax
SQL [TYPE] [IS] XML AS BLOB-FILE
SQL [TYPE] [IS] XML AS CLOB-FILE
SQL [TYPE] [IS] XML AS DBCLOB-FILE
Examples
BLOB-FILE
01 xmlblob-file1-hv-name SQL TYPE IS XML AS BLOB-FILE.

generates

01  xmlblob-file1-hv-name.                              
  49 xmlblob-file1-hv-name-name-length PIC S9(9) COMP-5.
  49 xmlblob-file1-hv-name-data-length PIC S9(9) COMP-5.
  49 xmlblob-file1-hv-name-file-option PIC S9(9) COMP-5.
  49 xmlblob-file1-hv-name-name PIC X(255).
CLOB-FILE
01 xmlclob-file1-hv-name SQL TYPE IS XML AS CLOB-FILE.

generates

01  xmlclob-file1-hv-name.                              
  49 xmlclob-file1-hv-name-name-length PIC S9(9) COMP-5.
  49 xmlclob-file1-hv-name-data-length PIC S9(9) COMP-5.
  49 xmlclob-file1-hv-name-file-option PIC S9(9) COMP-5.
  49 xmlclob-file1-hv-name-name PIC X(255).
DBCLOB-FILE
01 xmldbclob-file1-hv-name SQL TYPE IS XML AS DBCLOB-FILE.

generates

01  xmldbclob-file1-hv-name.                              
  49 xmldbclob-file1-hv-name-name-length PIC S9(9) COMP-5.
  49 xmldbclob-file1-hv-name-data-length PIC S9(9) COMP-5.
  49 xmldbclob-file1-hv-name-file-option PIC S9(9) COMP-5.
  49 xmldbclob-file1-hv-name-name PIC X(255).