ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

sqltype keyword syntax

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • sqltype keyword syntax

    Hello,

    Running on o/s 7.4.

    When using "sqltype(CLOB:10000)" is the "10000" value bytes, kb, mb, other? I can not find any documentation on the "sqltype" keyword.

    This: https://www.ibm.com/docs/en/db2-for-...e-objects-lobs states that CLOBs have a maximum size of 2GB - 1 byte yet if I try to define a field as per, it fails;
    Code:
    d responseMsg s sqltype(CLOB:2147483647) ccsid(1208)
    ...
    SQL0604 30 1 Attributes not valid.
    I therefore wondered if the value is KB not bytes, which saw it compile;
    Code:
    d responseMsg s sqltype(CLOB:2097152) ccsid(1208)
    But looking at the field;
    Code:
    *RNF7031 RESPONSEMSG                DS(2097156)             3D
    *RNF7031 RESPONSEMSG_DATA     A(2097152)                5D​​
    It appears to be 2097152A which would be 2097152 bytes aka 2MB?

    I welcome insight here.

    Cheers,

  • #2
    Found this in the Embedded SQL Programming manual: "1. For BLOB and CLOB host variables, the length must be in the range 1 to 16 773 100." The link you provided was for DB2 for z/OS documentation.

    Comment


    • #3
      Righty-o, that makes sense, thank you!

      Comment

      Working...
      X