# Oracle DML Error Logging and ORA-38908

Have you ever encountered an error like this?  
  
ORA-38908: internal error occurred during DML Error Logging ORA-00942: table or view does not exist ORA-02291: integrity constraint (T1.T1\_FK) violated - parent key not found  
  
You are probably using DML Error Logging, a statement like this  
  
insert into my\_tab (c1, c2, c3)  
select a.c1, a.c2, a.c3 from my\_other\_tab a  
LOG ERRORS INTO err$\_my\_tab ('oops') REJECT LIMIT UNLIMITED;  
  
The reason is that err$\_my\_tab (and probably my\_tab) is owned by a user A but the statement is being run by user B and user B does not have insert on err$\_my\_tab. It's fairly clear from the documenation that this is required.  
  

> Security  
>   
> The user who issues the INSERT statement with DML error logging must have INSERT privileges on the error logging table.

  
  
The problem is, this is the case even if the insert statement is part of a package (my\_pkg) and user B has execute on my\_pkg. It seems that user B should not need insert on err$\_my\_tab under this scenario, but it does. This is probably because the DML Error Logging uses autonomous transactions (I assume) and operates outside the context of the package. In this light, it makes sense.
