My Oracle Support Banner

OracleXMLSQLException: Illegal query from XMLQuery (Doc ID 2776505.1)

Last updated on JULY 20, 2024

Applies to:

Oracle XML Developers Kit - Version 12.1.2.0.0 and later
Oracle XML SQL Utility (XSU) - Version 12.1.2.0.0 and later
Information in this document applies to any platform.

Symptoms

A statement that does not begin with "SELECT" generates an OracleXMLSQLException ("Illegal query").  This prevents the use of statements with a "WITH" clause.

Example:

      String query = "WITH sub AS (SELECT 1 \"one\" FROM DUAL) SELECT * FROM sub";
      OracleXMLDataSetExtJdbc ds = new OracleXMLDataSetExtJdbc(con, query);


Stacktrace:

oracle.xml.sql.OracleXMLSQLException: Illegal query.
    at oracle.xml.sql.dataset.OracleXMLDataSet.processSQLQuery(OracleXMLDataSet.java:472)
    at oracle.xml.sql.dataset.OracleXMLDataSetExtJdbc.<init>(OracleXMLDataSetExtJdbc.java:199)
    at oracle.xml.sql.dataset.OracleXMLDataSetExtJdbc.<init>(OracleXMLDataSetExtJdbc.java:175)


Or

 

Changes

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.