Identifying XML values in an SQLDA

To indicate that a base type holds XML data, you must update the sqlname field in the associated SQLDA structure. If you do not indicate that a base type holds XML data, your embedded SQL application might not return the expected results.
To indicate that a base type holds XML data, the sqlname field of the SQLVAR must be updated as follows:
  • sqlname.length must be 8
  • The first two bytes of sqlname.data must be X'0000'
  • The third and fourth bytes of sqlname.data must be X'0000'
  • The fifth byte of sqlname.data must be X'01' (referred to as the XML subtype indicator only when the first two conditions are met)
  • The remaining bytes must be X'000000'

If the XML subtype indicator is set in an SQLVAR whose SQLTYPE is non-LOB, an SQL0804 error (rc=115) will be returned at runtime.

Note: SQL_TYP_XML can only be returned from the DESCRIBE statement. This type cannot be used for any other requests. The application must modify the SQLDA to contain a valid character or binary type, and set the sqlname field appropriately to indicate that the data is XML.