How to set timeout for anonoymous block or query in plsql?(如何在 plsql 中为匿名块或查询设置超时?)
问题描述
我知道您可以设置用户个人资料或设置查询的一般超时.>
但我希望为过程中的特定查询设置超时并捕获异常,例如:
开始更新 tbl 设置 col = v_val;--无限时间从 id = 20 的 tbl 中删除;--无限时间开始从 tbl 中删除;-- 我希望这有一个有限的时间来执行异常(超时???)然后- 代码;结尾;结尾;这可能吗?我能捕捉到任何超时异常吗?每个块或查询?没有找到关于该主题的太多信息.
不,您不能在 pl/sql 中设置超时.您可以为此使用宿主语言,在其中嵌入 sql 和 pl/sql.
I know you can set user profiles or set a general timeout for query.
But I wish to set timeout to a specific query inside a procedure and catch the exception, something like :
begin
update tbl set col = v_val; --Unlimited time
delete from tbl where id = 20; --Unlimited time
begin
delete from tbl; -- I want this to have a limited time to perform
exception when (timeout???) then
--code;
end;
end;
Is this possible? is there any timeout exceptions at all I can catch? per block or query? didn't find much info on the topic.
No, you can not set a timeout in pl/sql. You could use a host language for this in which you embed your sql and pl/sql.
这篇关于如何在 plsql 中为匿名块或查询设置超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 plsql 中为匿名块或查询设置超时?
基础教程推荐
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- 在多列上分布任意行 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
