Hi,
if you write Procedures and execute them via JDBC, selfwritten Error-Messages will be truncated after 70 chars. The whole errormessage although can be found in JobLog of our System i (AS400).
Is this a bug? Or does it work as designed. Can this be fixed?
Documentation says it should be 1000 chars:
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_73/db2/rbafzsignalstmt.htm
70 chars is only a limitation for DB2 LUW (we use System i AS400 / v7r3):
https://www.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0004232.html
BEGIN
SIGNAL SQLSTATE '38T00'
SET MESSAGE_TEXT = '1 2 3 4 5 6 7 8 9 100 1 2 3 4 5 6 7 8 9 ';
END;
Result System i Navigator:
System i Navigator
[ Mon Jan 13 11:39:01 CET 2020 ] Alle ausführen
> BEGIN SIGNAL SQLSTATE '38T00' SET MESSAGE_TEXT = '1 2 3 4 5 6 7 8 9 100 1 2 3 4 5 6 7 8 9 '; END
SQL-Status: 38T00
Vendorencode: -438
Nachricht: [SQL0438] 1 2 3 4 5 6 7
Verarbeitung wurde beendet, da die hervorgehobene Anweisung nicht erfolgreich abgeschlossen werden konnte
SQuirreL
Error: [SQL0438] 1 2 3 4 5 6 7
SQLState: 38T00
ErrorCode: -438
Job-Log AS400:
Teildatei QCMPD00001 zu Datei QSQLSRC in QTEMP hinzugefügt.
Datei QSQLT00000 in Bibliothek QTEMP erstellt.
Teildatei QCMPD00001 zu Datei QSQLT00000 in QTEMP hinzugefügt.
Eigentumsrecht für Objekt QCMPD00001 in QTEMP Art *MODULE geändert.
Module QCMPD00001 was created in library QTEMP on 13.01.20 at 11:37:52.
Eigentumsrecht für Objekt QCMPD00001 in QTEMP Art *PGM geändert.
Programm QCMPD00001 in Bibliothek QTEMP erstellt.
Objekt QCMPD00001 in QTEMP Art *MODULE wurde gelöscht.
Nachricht 1 2 3 4 5 6
7 8 9 100 1 2 3
4 5 6 7 8 9 wurde von
SIGNAL, RESIGNAL oder RAISE_ERROR zurückgegeben.
Objekt QCMPD00001 in QTEMP Art *PGM wurde gelöscht.
The JTOpen JDBC driver is currently getting the error message from the SQLCA which is limited to 70 characters. Tracing the data returned from the server, the full error message is available. I will be working on a fix for the next JTOpen release (10.3).
Last edit: John Eberhard 2020-01-13
The change to fix this was made to JDError.java and has been committed to the repository. It will be shipped in the next JTOpen release (10.3)