My Oracle Support Banner

Database Trigger will be Executed Twice After Table Creation in SQL Developer 4.0.3 (Doc ID 1951793.1)

Last updated on FEBRUARY 26, 2019

Applies to:

Oracle SQL Developer - Version 4.0 to 4.0 [Release 4]
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.


 DB trigger is being executed twice after creating table in SQL Developer 4.0.3. This issue occurs under the following conditions:

- Trigger is system trigger.

- Trigger contains "raise_application_error(-20000, 'CUSTOM ERROR');"


This issue can be reproduced with the following steps:


1. Create a table

for example:

create table testlog(log varchar2(255));

2. Create procedure as the following one:

for example:


SQL> create or replace procedure write_log(plog varchar2) is pragma
  insert into testlog(log) values (plog);

3. create system trigger which includes raise_application_error:

SQL> create or replace trigger insert_log after create on database
2  begin
   write_log('XXXXXX=' || ORA_DICT_OBJ_NAME);
   raise_application_error(-20000, 'CUSTOM ERROR');

Trigger created.

4. After creating a new table in SQL Developer, if you check table named testlog, you will find 2 inserted rows, meaning that trigger has been executed twice.



To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.