SnowConvert AI - Oracle - XML Types¶
Description¶
Extensible Markup Language (XML) is a standard format developed by the World Wide Web Consortium (W3C) for representing structured and unstructured data on the World Wide Web. Universal resource identifiers (URIs) identify resources such as Web pages anywhere on the Web. Oracle provides types to handle XML and URI data, as well as a class of URIs called
DBURIReftypes to access data stored within the database itself. (Oracle SQL Language Reference XML Types)
URIFactory Package¶
Description¶
Oracle also provides the
URIFactorypackage, which can create and return instances of the various subtypes of theURITypes. The package analyzes the URL string, identifies the type of URL (HTTP,DBURI, and so on), and creates an instance of the subtype. (Oracle SQL Language Reference URIFactory Package)
URIFactory contains the following subprograms:
GETURI¶
Oracle¶
Result¶
SYS.URIFACTORY.GETURI(‘HTTP://LOCALHOST/’).GETURL() |
|---|
http://localhost/ |
Snowflake¶
ESCAPEURI¶
Oracle¶
Result¶
SYS.URIFACTORY.ESCAPEURI(‘HTTP://WWW.<->’) |
|---|
http://www.%3C-%3E |
Snowflake¶
UNESCAPEURI¶
Oracle¶
Result¶
SYS.URIFACTORY.UNESCAPEURI(‘HTTP://WWW.%24-%26-%3C-%3E-%3F’) |
|---|
http://www.$-&-<->-? |
Snowflake¶
REGISTERURLHANDLER¶
Oracle¶
Snowflake¶
UNREGISTERURLHANDLER¶
Oracle¶
Snowflake¶
Known Issues¶
1. Subprograms of URIFactory Package are not recognized
SnowConvert AI does not transform subprograms of built-in packages. Most of the functionality of URI types is not currently supported by Snowflake.
2. Missing EWIs for URIFactory Package
The output code should display an EWI indicating that some functionality is not supported by Snowflake. There is a work item to fix this issue.
XMLType¶
Description¶
This Oracle-supplied type can be used to store and query XML data in the database.
XMLTypehas member functions you can use to access, extract, and query the XML data using XPath expressions. (Oracle SQL Language Reference XML Data Type)
Snowflake handles semi-structured data types (including XMLTYPE) using the VARIANT data type, for this reason, XMLTYPEs are to be migrated to VARIANT, and then usages of functions used to manipulate and query XML must be migrated to Snowflake’s counterparts. For more information on how to use XML in Snowflake, please refer to this post in the Snowflake forum and the TO_XML function documentation in Snowflake.
Sample Source Patterns¶
XMLType in Create Table¶
Oracle¶
Snowflake¶
Insert data in the XML column¶
Oracle¶
Snowflake¶
Known Issues¶
1. XMLType manipulation and query functions are not recognized¶
The functions for manipulating and querying XML such as XMLTYPE() are not being recognized nor transformed by SnowConvert.
Related EWIs¶
SSC-EWI-0036: Data type converted to another data type.
SSC-EWI-OR0016: XML is not supported.
URI Data Types¶
Description¶
Oracle supplies a family of URI types—
URIType,DBURIType,XDBURIType, andHTTPURIType—which are related by an inheritance hierarchy.URITypeis an object type and the others are subtypes ofURIType. (Oracle SQL Language Reference URI Data Types)
DBURIType¶
Note
Some parts in the output code are omitted for clarity reasons.
Description¶
DBURITypecan be used to storeDBURIRefvalues, which reference data inside the database. StoringDBURIRefvalues lets you reference data stored inside or outside the database and access the data consistently. (Oracle SQL Language Reference URI Data Types)
Sample Source Patterns¶
Note
Check this section to set up the sample database.
DBURIType in create table¶
Oracle¶
Snowflake¶
Retrieving data from DBURIType column¶
Oracle¶
Result¶
DT.DB_URITYPE_COLUMN.GETCLOB() |
|---|
¶ <FIRST_NAME>Shelley</FIRST_NAME>¶ |
This result query has XML syntax, this is how it is displayed:
Snowflake¶
Warning
getclob function is not being transformed by the tool, but is necessary to display the data in Oracle, this transformation is going to be available in future releases.
Known Issues¶
1. DBURIType Data Type not recognized
DBURIType is parsed and converted as Custom Data Type by SnowConvert AI or as not supported type if it uses the prefix SYS, there is a work item to fix this issue
Related EWIs¶
SSC-EWI-0028: Type not supported.
SSC-EWI-0062: Custom type usage changed to variant
SSC-EWI-0073: Pending functional equivalence review
HTTPURIType¶
Note
Some parts in the output code are omitted for clarity reasons.
Description¶
You can use
HTTPURITypeto store URLs to external Web pages or to files. Oracle accesses these files using HTTP (Hypertext Transfer Protocol). (Oracle SQL Language Reference URI Data Types)
Sample Source Patterns¶
HTTPURIType in create table¶
Oracle¶
Snowflake¶
Retrieving data from HTTPURIType column¶
Oracle¶
Result¶
UT.HTTP_URITYPE_COLUMN.GETURL() |
UT.HTTP_URITYPE_COLUMN.GETEXTERNALURL() |
|---|---|
http://localhost/ |
http://localhost/ |
http://www.google.com |
http://www.google.com |
Snowflake¶
Warning
getUrl and getExternalUrl functions are not being transformed by the tool, but are necessary to display the data in Oracle, this transformation is going to be available in future releases.
Known Issues¶
1. HTTPURIType Data Type not recognized
HTTPURIType is parsed and converted as Custom Data Type by SnowConvert AI or as not supported type if it uses the prefix SYS, there is a work item to fix this issue
Related EWIs¶
SSC-EWI-0028: Type not supported.
SSC-EWI-0062: Custom type usage changed to variant.
SSC-EWI-0073: Pending functional equivalence review.
XDBURIType¶
Note
Some parts in the output code are omitted for clarity reasons.
Description¶
You can use
XDBURITypeto expose documents in the XML database hierarchy as URIs that can be embedded in anyURITypecolumn in a table. TheXDBURITypeconsists of a URL, which comprises the hierarchical name of the XML document to which it refers and an optional fragment representing the XPath syntax. (Oracle SQL Language Reference URI Data Types)
Sample Source Patterns¶
XDBURIType in create table¶
Oracle¶
Snowflake¶
Retrieving data from XDBURIType column¶
Oracle¶
Result¶
UT.XDB_URITYPE_COLUMN.GETCLOB() |
|---|
<emp_name>selby</emp_name> |
This result query has XML syntax, this is how it is displayed:
Snowflake¶
Warning
getclob function is not being transformed by the tool, but is necessary to display the data in Oracle, this transformation is going to be available in future releases.
Known Issues¶
1. XDBURIType Data Type not recognized
XDBURIType is parsed and converted as Custom Data Type by SnowConvert AI or as not supported type if it uses the prefix SYS, there is a work item to fix this issue
Related EWIs¶
SSC-EWI-0028: Type not supported.
SSC-EWI-0062: Custom type usage changed to variant
SSC-EWI-0073: Pending functional equivalence review