Reputation: 11
I know we can set timeout using resource manager at schema level. But I want to set timeout to a specific query inside a procedure and catch the exception. lets say i want to stop query execution for specific query after 15 secs. Is there any way for this? Or any timeout exception available? I am using Oracle Db 12.2. Thanks.
Upvotes: 1
Views: 1184
Reputation: 142720
As far as I can tell, there's no such thing.
However, see if this helps:
dbms_scheduler
)dba_scheduler_running_jobs
dbms_scheduler.stop_job
)Yes, I know - you're talking about a query within a procedure. It makes things more complex as the rest of the procedure should wait for that particular query (now transformed to job) to finish.
Though, if it were a loop, you could set a timer and check it in every loop iteration and then exit the loop if it runs longer than 15 seconds. Maybe you can make that query to use condition you'd put into e.g. cursor FOR loop's where
clause ...
Upvotes: 1