XML message documents
When a common SQL API stored procedure
encounters an internal processing error or invalid parameter, the
data server returns a SQLCODE and the corresponding SQL message to
the caller.
When this occurs, the procedure returns an
XML message document in the xml_message parameter
that contains more detailed information about the warning situation.
The XML message document has the following general structure:
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>Document Type Name</key><string>Data Server Message</string>
<key>Document Type Major Version</key><integer>1</integer>
<key>Document Type Minor Version</key><integer>0</integer>
<key>Data Server Product Name</key><string>QDB2/AIX64</string>
<key>Data Server Product Version</key><string>9.5.0.3</string>
<key>Data Server Major Version</key><integer>9</integer>
<key>Data Server Minor Version</key><integer>5</integer>
<key>Data Server Platform</key><string>AIX 64BIT</string>
<key>Document Locale</key><string>en_US</string>
<key>Short Message Text</key>
<dict>
<key>Value</key><string>
<!-- Additional description of warning appears here. --></string>
<key>Hint</key><string></string>
</dict>
</dict>
</plist>
XML message documents are generated in UTF-8 and contain English characters only.
Example
In the following example, a call to the GET_MESSAGE procedure results in an SQL warning:db2 "CALL SYSPROC.GET_MESSAGE(NULL,NULL,'en_US',NULL,NULL,?,?)"
SQL20458W The procedure "SYSPROC.GET_MESSAGE" has encountered
an internal parameter processing error in parameter "3".
The value for parameter "7" contains further information about
the error. SQLSTATE=01H54
The
XML document that is returned in parameter 7 (xml_message) contains the following
content:<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>Document Type Name</key><string>Data Server Message</string>
<key>Document Type Major Version</key><integer>1</integer>
<key>Document Type Minor Version</key><integer>0</integer>
<key>Data Server Product Name</key><string>QDB2/AIX64</string>
<key>Data Server Product Version</key><string>9.5.0.3</string>
<key>Data Server Major Version</key><integer>9</integer>
<key>Data Server Minor Version</key><integer>5</integer>
<key>Data Server Platform</key><string>AIX 64BIT</string>
<key>Document Locale</key><string>en_US</string>
<key>Short Message Text</key>
<dict>
<key>Value</key><string>If parameters 1 and 2 are set to NULL, all
other input parameters must be set to NULL as well, but the value
of parameter "3" is not NULL. </string>
<key>Hint</key><string></string>
</dict>
</dict>
</plist>
The value for the Short Message Text key provides additional information about the warning.