A couple of months ago we discussed accessing the GDB_Items.Definition column of a 10.0 Geodatabase to extract information about the Geodatabase’s schema without ArcObjects (See part 1, part 2, and part 3).
Those posts mentioned two approaches for doing this. The first was to retrieve the Definition column’s value and query it using an API with a Document Object Model implementation. The second was to use the DBMS’s native XML functionality to retrieve specific nodes of the XML value.
Although using DBMS XML functions is usually preferable, it isn’t always possible to do so. One example of this is when using a Personal Geodatabase; since Access doesn’t have an XML type, the Definition column uses the Memo type instead.
The following example shows how to display the code/value pairs of a coded value domain named “PipeType” from a Personal Geodatabase using C# and classes from the System.Xml.XPath namespace:
Another case where native XML functions aren’t available is when accessing an ArcSDE geodatabase in Oracle. Due to limitations with the XML type in Oracle 10g, XML columns in Oracle geodatabase system tables use the ArcSDE XML type rather than the native Oracle type.
To enable reading these values without ArcSDE or ArcObjects libraries, views have been created for the two system tables with XML columns, GDB_Items and GDB_ItemRelationships, named GDB_Items_Vw and Gdb_ItemRelationships_Vw respectively. These views replace the XML columns of the actual tables with CLOB columns that can be read as text.
The following example shows how to display the code/value pairs of a coded value domain from an Oracle Geodatabase using C# and classes from the System.Xml.Linq namespace:
To query and view the contents of the CLOB columns, the Oracle server must be configured in a similar manner to use sql with ST_Geometry.
Refer to the “Configuring the Oracle listener to use ST_Geometry and ST_Raster” topic for more info on that.