控制sqlrpgle中的提交和回滚

发布于 2025-02-13 21:41:00 字数 36 浏览 0 评论 0原文

嗨,有人可以告诉我如何控制sqlrpgle中的提交和回滚。

Hi can some one tell me how to control the commit and rollback in a SQLRPGLE.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烦人精 2025-02-20 21:41:00

取决于您的控制含义...

commit a>和回滚陈述

if someerror;
  exec SQL rollback;
else;
  exec SQL commit;
endif;

默认为整个模块使用的承诺控件级别

请注意,模块中只能设置一个set option,它必须从物理上是第一个SQL语句,请参见源文件中的第一个SQL语句。

最后,对于任何给定的SQL语句,您可以使用&xxx> 隔离– clause

insert into mytable (fld1, fld2) 
  values ("Hello", "World")
with CHG;

Depends on what you mean by control...

There's the COMMIT and ROLLBACK statements

if someerror;
  exec SQL rollback;
else;
  exec SQL commit;
endif;

You can control the level of commitment control used by default for the entire module via

Note that there can be only one SET OPTION in the module and it must physically be the first SQL statement see in the source file.

Lastly, for any given SQL statement, you can override the default commitment level by using the WITH <xxx> isolation–clause.

insert into mytable (fld1, fld2) 
  values ("Hello", "World")
with CHG;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文