IBM Support

UTL_MAIL.SEND procedure returns a UTL_TCP.BAD_ARGUMENT message.

Troubleshooting


Problem

Attempts to use the UTL_MAIL module UTL_MAIL.SEND result in an error returned containing the string UTL_TCP.BAD_ARGUMENT and refering to "UTL_TCP.IMP_WRITE_TEXT with a SQLSTATE= 5UA01 .

Symptom

Calls to UTL_MAIL.SEND either directly or through a stored procedure result in a UTL_TCP.BAD_ARGUMENT SQLSTATE=5UA01 message being returned. The message should also refer to the "UTL_TCP.IMP_WRITE_TEXT". If called from within a stored procedure the UTL_TCP.BAD_ARGUMENT message may be returned as part of a SQL0443 error.

Cause

A NULL character is being passed into the message field of the UTL_MAIL.SEND procedure

Diagnosing The Problem

Verify that the error message contains the phrase UTL_TCP.BAD_ARGUMENT and refers to UTL_TCP.IMP_WRITE_TEXT with a SQLSTATE=5UA01. If called from a Stored Procedure the following error message will be in the db2diag.log.


2014-09-12-00.00.00.399483-180 E60716050E957 LEVEL: Warning
PID : 13207 TID : 47495656761668 PROC : db2sysc 0
INSTANCE: db2inst1 NODE : 000 DB : MYDB
APPHDL : 0-31687 APPID: *LOCAL.db2inst1.140912090003
AUTHID : DB2INST1
EDUID : 15475 EDUNAME: db2agent (MYDB) 0
FUNCTION: DB2 UDB, runtime interpreter, sqlriTrustedTruncateTokensUserSqlState, probe:100
DATA #1 : signed integer, 4 bytes
-443
DATA #2 : String with size, 5 bytes
5UA0I
DATA #3 : String with size, 32 bytes
SYSIBMADM.UTL_TCP.IMP_WRITE_TEXT
DATA #4 : String with size, 22 bytes
UTL_TCP_IMP_WRITE_TEXT
DATA #5 : String with size, 20 bytes
UTL_TCP.BAD_ARGUMENT Page 14 of 61
DATA #6 : signed integer, 4 bytes
68
DATA #7 : signed integer, 4 bytes
22
DATA #8 : signed integer, 4 bytes
22
DATA #9 : signed integer, 4 bytes
20

Resolving The Problem

Ensure that a the application or routine calling the UTL_MAIL.SEND procedure does not send a NULL character in the message field argument.

Related Information

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"DB2 Tools - Troubleshooting","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.8;9.7;10.1;10.5","Edition":"Advanced Enterprise Server;Advanced Workgroup Server;Enterprise Server;Express;Express-C;Personal;Workgroup Server","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21686028