XML

XMLTABLE to convert XML to relational data

XMLTABLE: Convert XML Payload to Relational Form

Here’s a prototype for using the SQL/XML function XMLTABLE to map XML data into relational rows and columns. This solution uses the standard EMP table – the same can be extended to work with any XMLTYPE-relational mapping.

Read the Full Article →
Oracle XML Object-Relational Storage

Oracle XML Object-Relational Storage [EXAMPLE]

After the post on models for storing XML data in Oracle and examples of binary XML storage, here’s a detailed look at the rigorous and performant structured XML storage or object-relational storage.

Read the Full Article →
Oracle Binary XML Storage

Oracle Binary XML Storage, With or Without XML Schema [EXAMPLE]

The previous post on storing XML data in Oracle gave an overview of binary XML storage: compact, flexible, compatible with XML data with or without associated XML schema. This post shows working examples of binary XML storage 1.1. without XML Schema 1.2 with XML Schema

Read the Full Article →
Storing XML Data in Oracle: Binary XML, Object-Relational, CLOB

Storing XML Data in Oracle: Binary XML, Object-Relational, CLOB

Oracle provides an abstract SQL data type called XMLType for storing XML data in the database. You can create an XMLType table,  or an XMLType column in a relational table, to persist XML data. Different storage models are available in Oracle to best fit the nature of the XML data and its expected use. These […]

Read the Full Article →
SQL XML in Oracle: Generating XML from Relational Data

Generating XML from Relational Data using Oracle SQL/XML

Oracle has built-in functions to convert relational data into XML format easily. These functions comes under the umbrella of SQL/XML, a specification that supports the mapping and manipulation of XML from SQL. This post shows you how to generate XML from relational data using Oracle SQL/XML functions as building blocks.

Read the Full Article →
Thumbnail image for Access Control List (ACL) in Oracle 11G

Access Control List (ACL) in Oracle 11G

I recently upgraded Oracle XE from 10G to 11G, and found that none of the PL/SQL code using UTL_HTTP was working after upgrade. The code failed with the error: Oracle 10G used to be happy as long as the user running network packages like UTL_HTTP had execute permission on the package. Oracle 11G and above […]

Read the Full Article →
Thumbnail image for UTL_HTTP to Call a Web Service from PL/SQL

UTL_HTTP to Call a Web Service from PL/SQL

You can call a web service from within PL/SQL using the Oracle-supplied package UTL_HTTP. Here’s a demo of calling a public web service that returns latest city weather by ZIP.

Read the Full Article →
Referencing User Defined Types over DBLink

Referencing User Defined Types over DBLink: Problem and Alternatives

Consider a PL/SQL call to a function which returns a user-defined type (UDT) – say, a SQL Type object. This works well as long as the called function resides in the same database as the calling PL/SQL, but if the called function is in a remote database, the PL/SQL call via DBLink end ups with […]

Read the Full Article →
PIVOT in Oracle to Select Rows As Columns

PIVOT in Oracle 11G to Select Rows As Columns

A frequent requirement in SQL is to "pivot" a result set – that is, display rows as columns. Before 11G, the developer had to do the equivalent of jumping through hoops to pivot the data. In 11G, with the introduction of the new PIVOT syntax, the task of transposing rows to columns has become a […]

Read the Full Article →