可用版本: Dev (3.21) | 最新 (3.20) | 3.19 | 3.18 | 3.17 | 3.16 | 3.15

CREATE PROCEDURE

适用于 ❌ 开源版   ✅ Express 版   ✅ 专业版   ✅ 企业版

CREATE PROCEDURE 语句允许在您的目录中创建存储过程。

存储函数 相反,存储过程预计会产生某种副作用,因此不能在 SQL 语句中使用。

创建此类过程的一个简单示例是

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

创建上述过程后,您可以运行代码生成以获取类型安全的存根来调用它们,或者在 匿名块 中使用 CALL,或者直接

// 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();

反馈

您对本页面有什么反馈吗? 我们很想听听您的意见!

The jOOQ Logo