Retrieval of an entire XML document from an XML column

Retrieval of an entire XML document from an XML column is similar to retrieval of a value from a LOB column.

Retrieval of an entire XML document is different from retrieval of a LOB value in the following ways:
  • LOB values can have locators, but XML values cannot.
    This means that you need to do one of these things:
    • Allocate enough application storage to retrieve entire XML values, use file reference variables, or use the SQL FETCH WITH CONTINUE statement.
    • Invoke XMLSERIALIZE to convert the XML column data into a CLOB or BLOB data type, and fetch the result into a LOB locator.
  • XML values can have internal encoding as well as external encoding.

    With LOB values, you need to consider only whether there are differences between the database server encoding and the application encoding when you retrieve data. XML values can have internal encoding as well as application encoding (external encoding).