Skip to Main Content

Oracle Database Free

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DROP ROLE IF EXISTS is not documented. Bug or Undocumented Feature?

The following can be executed connected as SYS under an Oracle AI Database 26.1 FREE:

create role if not exists demo_role;
select count(*) from dba_roles where role = 'DEMO_ROLE';
drop role if exists demo_role;
select count(*) from dba_roles where role = 'DEMO_ROLE';

The output in SQLcl looks like this:

SQL> create role if not exists demo_role;

Role DEMO_ROLE created.

SQL> select count(*) from dba_roles where role = 'DEMO_ROLE';

  COUNT(*)
----------
         1

SQL> drop role if exists demo_role;

Role DEMO_ROLE dropped.

SQL> select count(*) from dba_roles where role = 'DEMO_ROLE';

  COUNT(*)
----------
         0

However, the DROP ROLE IF EXISTS syntax is not documented in the SQL Language Reference.

Is this a documentation bug?

This post has been answered by MartinBach-Oracle on Apr 9 2026
Jump to Answer
Comments
Post Details
Added on Apr 6 2026
5 comments
167 views