AV with XMLTYPE

The SELECT in the following script causes this error:

CREATE TABLE toad_test( id NUMBER(30), val XMLTYPE );

INSERT INTO toad_test VALUES( 1, '<?xml version="1.0" encoding="UTF-8"?>
<int xmlns="http://schemas.microsoft.com/2003/10/Serialization/">1</int>
' );

SELECT * FROM toad_test;

Access violation at address 00007FF986101C7A in module 'OraOCIEI12.dll'. Read of address 0000000000000010

Can you reproduce this?

XMLType isn’t supported very well by the OCI when in Unicode mode (which is what Toad uses), so Toad can’t support it very well either.

When you create an XMLTYPE column like that, without specifying ‘store as binary’, or ‘store as clob’, it will default to binary. Toad can handle it in a read-only fashion as clob, but not at all as binary.

You can cast your binary XML column to clob this way:

select ID, Val.GetClobVal() as Val

from toad_test;

If you find your table in the schema browser and look at the data tab, Toad will automatically query your table using GetClobVal and you should see the data without error in a read-only fashion. If you want to query it in the Editor, you should add GetClobVal() yourself.