Available in versions: Dev (3.20) | Latest (3.19) | 3.18 | 3.17 | 3.16 | 3.15


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

The CREATE PROCEDURE statement allows for creating stored procedures in your catalog.

A stored procedure, as opposed to a stored function, is expected to have side effects of some sort, and can thus not be used in SQL statements.

A simple example for creating such a procedure is:

// Create a procedure that inserts a log message in a table
      .as(insertInto(LOG).columns(LOG.TEXT).values("Log called"))

Once you've created the above procedure, you can either run code generation to get a type safe stub for calling them, or use CALL in an anonymous block, or directly:

// Call the previously created procedure with generated code:

// ...or with the CALL statement in an anonymous block

// ...or with the CALL statement directly


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

The jOOQ Logo