In the db where its running fine do the following in SQL Plus
1. select * from v$version
2. execute your anonymous block
3. select * from aerbill_traffic.procedure_status; -- Just filter for the one record inserted in step 2.
Now do a copy past of output obtained into this forum.
Why are you using a WHEN OTHERS in the first place? Why swallowing errors you do not expect? Why dont you RAISE the error back to the caller?
Anyway, move the insert_statement into a separate procedure defined as an autonomous transaction with the desired parameters and call that procedure from your exception block.
The SQLERRM function can't be used directly in a sql statement.
In any case, this code is kind of frightening. In any exception you're going to insert into a table AND commit with no re-raise?
The SQLERRM function can't be used directly in a sql statement
Strange thing is that OP stats it works on one DB and doesn't on another.
In any case, this code is kind of frightening.
(hence I posted Tom's rant again, must be the 102389560242634th time... hopefully it enlightens OP )
It is possible that it complies in one of the environments because a function exists with the same name, e.g.
CREATE OR REPLACE FUNCTION sqlerrm
But I am **NOT** recommending you wrap built-ins in this way.