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

Labels

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

In imperative languages, labels are essential with simpler cases of loops (e.g. the LOOP statement), with nested loops, or if you must, when using the GOTO statement.

Using jOOQ, you can label any org.jooq.Statement by using DSL.label():

-- PL/SQL
<<label>>
BEGIN NULL; END;
// All dialects
Label label = label("label");
label.label(begin())

That's a lot of labels.

The main usages of these labels will be discussed in the following sections about, EXIT, and CONTINUE

Dialect support

This example using jOOQ:

l.label(deleteFrom(BOOK))

Translates to the following dialect specific expressions:

-- AURORA_POSTGRES, INFORMIX, ORACLE, POSTGRES, YUGABYTE
<<l>>
DELETE FROM BOOK

-- DB2, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, SQLDATAWAREHOUSE, SQLSERVER
l:
DELETE FROM BOOK

-- ACCESS, ASE, AURORA_MYSQL, BIGQUERY, COCKROACHDB, DERBY, EXASOL, HANA, IGNITE, MEMSQL, REDSHIFT, SNOWFLAKE, SQLITE, SYBASE, 
-- TERADATA, VERTICA
/* 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