I have just upgraded my Oracle Client from version 10.1 to 10.2 and now TXMLType.Create throws an Exception with Oracle error code ORA-21500. I can reproduce this with a test application containing just a form with a TOracleSession and a TOracleLogon component on it:
Code
procedure TForm1.btTestClick(Sender: TObject);
var
xml : String;
xmlType : TXMLType;
begin
if not OracleLogon1.Execute then
exit;
xmlType := nil;
try
xml := '<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?><test />';
xmlType := TXMLType.Create(OracleSession1, xml); // this line throws an EOracleError
finally
xmlType.Free;
OracleSession1.LogOff;
end;
end;
With Oracle client version 10.1 it works fine. The error code indicates this is an Oracle bug, can you confirm this is indeed the case? Are there any known workarounds?
Im am using Delphi 7 with DOA 4.06.2 on Windows 2000. Oracle Server is 10g Release 10.1.0.4.0
If it works on 10.1 and fails with OCI-21500 on 10.2, then it does indeed sound like an Oracle Client bug. DOA uses the exact same OCI calls on 10.1 and 10.2.
Marco, I checked metalink and found that Oracle has classified bug 5846373 as unreproducable and "not a bug". (The original report said it was intermittent). If this is not an open issue with Oracle will you pursue the matter? -- it hapens consistently when creating an XMLType using DOA (v. 4.0.7), Oracle 10.2.0.3 database and 10.2.0.3 client.
The best way to insert or update XMLTYPE values is to use the XMLTYPE.CreateXML(:clob_variable) function. This can be used in an insert or update statement to pass the value to the XMLTYPE column, but instead of passing an XMLTYPE instance from the client you pass a temporary CLOB with the XML text.