Skip to content
Snippets Groups Projects
Commit 49e93995 authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Fixed dropping of the Advanced Queuing items : ignore PLSQL errors that...

Fixed dropping of the Advanced Queuing items : ignore PLSQL errors that DBMS_AQADM must be declared so that the dropping does not fail on DBs where Advanced Queuing is not used at all
parent 6ab2c7aa
No related branches found
No related tags found
No related merge requests found
......@@ -45,8 +45,23 @@ BEGIN
ELSIF rec.object_type = 'SYNONYM' THEN
EXECUTE IMMEDIATE 'DROP SYNONYM '||rec.object_name;
ELSIF rec.object_type = 'QUEUE' THEN
DBMS_AQADM.STOP_QUEUE(queue_name => rec.object_name);
DBMS_AQADM.DROP_QUEUE(queue_name => rec.object_name);
DECLARE
compilation_error exception;
pragma exception_init(compilation_error, -6550);
BEGIN
execute immediate 'DBMS_AQADM.STOP_QUEUE(queue_name => rec.object_name);';
execute immediate 'DBMS_AQADM.DROP_QUEUE(queue_name => rec.object_name);';
EXCEPTION WHEN compilation_error THEN
DECLARE
error_code VARCHAR2(20) := regexp_substr(dbms_utility.format_error_stack, '(PLS-[[:digit:]]+):', 1, 1, '', 1);
BEGIN
-- Ignore PLS-00201: identifier 'DBMS_AQADM' must be declared
-- as obviously, there is nothing to be dropped
IF error_code != 'PLS-00201' THEN
RAISE;
END IF;
END;
END;
END IF;
EXCEPTION WHEN OTHERS THEN
-- Ignore: ORA-04043: "object string does not exist" or
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment