CREATE PROCEDURE
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 create.createProcedure("log") .as(insertInto(LOG).columns(LOG.TEXT).values("Log called")) .execute();
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: log(configuration); // ...or with the CALL statement in an anonymous block create.begin(call(name("log"))).execute(); // ...or with the CALL statement directly call(name("log")).execute();
Table of contents
- 3.4.3.5.1.
- CREATE OR REPLACE PROCEDURE (new)
- 3.4.3.5.2.
- SQL data access characteristics (new)
previous : next |
References to this page
Feedback
Do you have any feedback about this page? We'd love to hear it!