New versions: Dev (3.16) | Latest (3.15) | 3.14

DOCUMENT predicate

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

The DOCUMENT predicate can be used to check if a given expression is an XML document (as opposed to toher XML content).

SELECT 1
WHERE
  '<xml/>' IS DOCUMENT
  AND '<!-- comment -->' IS NOT DOCUMENT
create.selectOne()
      .where(val("<xml/>").isDocument())
      .and(val("<!-- comment -->").isNotDocument())
      .fetch();

Dialect support

This example using jOOQ:

AUTHOR.FIRST_NAME.isDocument()

Translates to the following dialect specific expressions:

-- POSTGRES
AUTHOR.FIRST_NAME IS DOCUMENT

-- ACCESS, ASE, AURORA_MYSQL, AURORA_POSTGRES, BIGQUERY, COCKROACHDB, DB2, DERBY, EXASOL, FIREBIRD, H2, HANA, HSQLDB, IGNITE, 
-- INFORMIX, MARIADB, MEMSQL, MYSQL, ORACLE, REDSHIFT, SNOWFLAKE, SQLDATAWAREHOUSE, SQLITE, SQLSERVER, SYBASE, TERADATA, 
-- VERTICA, YUGABYTE
/* UNSUPPORTED */

(These are currently generated with jOOQ 3.16, see #10141), or translate your own on our website

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo