Hello,
I had the tipical error of having an execute immediate within a trigger which was not autonomous.
So I packed up the triger code, placed in a procedure and made it Autonomous (triger could have been autonomus but it gave me an excuse to clean up the code).
This fixed the problem and everyone is happy... sort of.
The problem that I now have, is that I have no clue if the "execute immediate" command was succesful or not.
The triger that I have alters a table, it will create a column on insert.
But if the alter table fails for some reason, I need the insert command to fail. So that the user knows that the column was not created.
I thought about doing a select from USER_TAB_COLUMNS after calling the autonomous procedure, but this gives me no guarantee that it failed/succeded, if the server is busy, maybe the command is "on queue". Is this a correct asumption?
What would be a "proper" way of solving this?
Thanks.
Start Free Trial