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

This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.

CREATE OR REPLACE FUNCTION

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

In most cases, you will want to CREATE OR REPLACE a function, not CREATE [ OR FAIL ] when the function already exists. For this, just use the auxiliary OR REPLACE clause, which can be emulated by jOOQ via an additional DROP FUNCTION statement if this syntax is not available in your dialect.

// Create a function that always return 1
create.createOrReplaceFunction("one")
      .returns(INTEGER)
      .as(return_(1))
      .execute();

References to this page

Feedback

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

The jOOQ Logo