Skip to content

Commit 46cc1fe

Browse files
Fix occasional "ORA-38810: cannot drop edition that has a parent".
1 parent 1b5a4cb commit 46cc1fe

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

samples/sql/drop_schema.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*-----------------------------------------------------------------------------
2-
* Copyright 2017, 2022, Oracle and/or its affiliates.
2+
* Copyright 2017, 2025, Oracle and/or its affiliates.
33
*
44
* This software is dual-licensed to you under the Universal Permissive License
55
* (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
@@ -43,7 +43,9 @@ begin
4343
for r in
4444
( select edition_name
4545
from dba_editions
46-
where edition_name in (upper('&edition_name'))
46+
start with edition_name = upper('&edition_name')
47+
connect by prior edition_name = parent_edition_name
48+
order by level desc
4749
) loop
4850
execute immediate 'drop edition ' || r.edition_name || ' cascade';
4951
end loop;

tests/sql/drop_schema.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*-----------------------------------------------------------------------------
2-
* Copyright (c) 2020, 2022, Oracle and/or its affiliates.
2+
* Copyright (c) 2020, 2025, Oracle and/or its affiliates.
33
*
44
* This software is dual-licensed to you under the Universal Permissive License
55
* (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
@@ -43,7 +43,9 @@ begin
4343
for r in
4444
( select edition_name
4545
from dba_editions
46-
where edition_name in (upper('&edition_name'))
46+
start with edition_name = upper('&edition_name')
47+
connect by prior edition_name = parent_edition_name
48+
order by level desc
4749
) loop
4850
execute immediate 'drop edition ' || r.edition_name || ' cascade';
4951
end loop;

0 commit comments

Comments
 (0)