Print Thread
XML object examples
#8056 12/23/05 08:46 PM
Joined: Oct 2000
Posts: 15
Wilmington, DE, USA
D
dgsmith Offline OP
Member
OP Offline
Member
D
Joined: Oct 2000
Posts: 15
Wilmington, DE, USA
I'd like to see some examples of code that uses the object version of Direct Oracle Access to work with XMLtype fields, but I haven't found any. If someone could direct me to (or post) one, I'd appreciate it. Thanks.


David Smith
Re: XML object examples
#8057 12/30/05 04:58 PM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
From the documentation:

The SYS.XMLTYPE object was introduced in Oracle9 to encapsulate XML in the Oracle database. In Oracle9.2 this object type can be accessed from the Oracle Net 9.2 client. The TXMLType provides an easy interface to the SYS.XMLTYPE object type. The TXMLType object descends from TOracleObject, and can therefore be used anywhere that you can use a TOracleObject (for example, when assigning an object instance to a variable through SetComplexVariable).

The XML text of a TXMLType instance can be set during creation:
Code
var
  XML: TXMLType;
begin
  XML := TXMLType.Create(MainSession, '<message>Hello World</message>');
  try
    XMLQuery.SetComplexVariable('xmlvar', XML);
    XMLQuery.Execute;
  finally
    XML.Free;
  end;
end;
The XML text of a TXMLType instance can be retrieved through the XML read-only property.

The TOracleQuery.XMLField and TOracleObject.XMLAttr functions return a TXMLType instance for a field or attribute.

Note
The XMLType object can only be used with Oracle9.2.


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.035s Queries: 14 (0.010s) Memory: 2.4959 MB (Peak: 3.0380 MB) Data Comp: Off Server Time: 2024-05-04 08:32:01 UTC
Valid HTML 5 and Valid CSS