如何在plsql中为匿名块或查询设置超时? [英] How to set timeout for anonoymous block or query in plsql?
本文介绍了如何在plsql中为匿名块或查询设置超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道您可以设置用户配置文件或设置查询的一般超时时间.
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.
推荐答案
否,您不能在pl/sql中设置超时.为此,您可以使用宿主语言来嵌入sql和pl/sql.
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中为匿名块或查询设置超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文