Search code examples
db2db2-luw

DB2 Cutted trigger message


I have implemented a trigger with very large exception message, doing on this way

SIGNAL SQLSTATE '010101' SET MESSAGE_TEXT = MY_TEXT;

In case, this error occurs, the message is cut off. I think in DB2 LUW the max length is 1000 bytes. Will be a possibility to show the whole message?


Solution

  • on Db2-LUW the documented limit on the length of the message_text is 70 bytes (not 1000 as per your question). Any longer length gets truncated.

    If you want to preserve the longer message then change your exception handler , for example to write the longer message into some table, or write it to a file or pipe etc.