ORA-06512: at “SYS.UTL_TCP”

I was developing a new package which was carrying out some  maintenance processes, such as partitioning logging tables and dropping the old  partitions. As part of the process, my procedure would email out the errors when  running. The first stage, however, was to get the procedure to compile. I was  getting the following errors:

ERROR at line 1:
ORA-29261: bad argument
ORA-06512: at “SYS.UTL_TCP”, line 28
ORA-06512: at “SYS.UTL_TCP”, line 257
ORA-06512: at “SYS.UTL_SMTP”, line 115
ORA-06512: at “SYS.UTL_SMTP”, line 138
ORA-06512: at “STATS.PRCSENDEMAIL”, line 135
ORA-06512: at line 1

The procedure which I had created selected the DB name from  v$database, then set the email server variables depending on which environment  it was on. The DB I was running it on was not included in the list which is why  it was failing; there was no ELSIF statement included at the time.

So, the conclusion is that you should check all of the logic  of your code before you start thinking there is something else, more complex  usually, at fault. It’s usually something very basic in my opinion.

Like it, share it...

Category: PL/SQL

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *