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 中为匿名块或查询设置超时?
- 导入具有可变标题的 Excel 文件 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- SQL 临时表问题 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
