Patent ID: 7516121

Claim:
A method of processing a query, comprising: receiving the query, wherein the query specifies operations; determining that the query comprises a Structured Query Language (SQL) portion that specifies first one or more of said operations in SQL query language and a markup language portion that specifies second one or more of said operations in a markup query language; wherein the markup query language is one of XQuery query language and XQueryX query language; wherein, within the query, the markup language portion is embedded into the SQL portion; generating a first in-memory representation for the SQL portion; generating a second in-memory representation for the markup language portion; generating a third in-memory representation of the query based on the first in-memory representation and the second in-memory representation, wherein the third in-memory representation specifies all of said operations; and performing said operations based on the third in-memory representation; wherein the first in-memory representation and the third in-memory representation are formatted in a first abstract syntax and the second in-memory representation is formatted in a second abstract syntax, and wherein the step of generating the third in-memory representation comprises: generating a fourth in-memory representation in the first abstract syntax based on the second in-memory representation; and generating the third in-memory representation based on the first in-memory representation and the fourth in-memory representation; wherein the first abstract syntax is an SQL-related abstract syntax and the second abstract syntax is an XQuery-related abstract syntax; and wherein the markup language portion comprises a user-defined XQuery function in the second abstract syntax; and wherein the step of generating the fourth in-memory representation comprises generating a user-defined PL/SQL function in the first abstract syntax based on the user-defined XQuery function in the second abstract syntax.