Skip to content
Advertisement

How to set timeout for anonoymous block or query in 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.

Advertisement

Answer

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.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement