Hi everyone! A team I am helping is developing an application in node.js where on the back end we call SQL queries from node.js that execute inserts and update statements against tables. The issue we are having is if an insert or update statement has a field with data too long for a defined column, we just get back an SQL error code/state saying:
"[Error: [IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=22001]"
which on IBMs docs for db2 has this translation for the 22001 state:
22001 Character data, right truncation occurred; for example, an update or insert value is a string that is too long for the column, or a datetime value cannot be assigned to a variable, because it is too small.
Our goal is to output to the user on the front end that they attempted to enter data that is too long, wrong type, etc, and for which column(s). Does anyone have DB2 or node.js application development experience wisdom to share here? We do have an idea how to solve this ourselves but figured it is worth asking what exists first as it seems something should!
------------------------------
Jeffrey Willoughby
------------------------------