When I try to insert, by an elaborate procedure, in a Firebird table a longer string than the one I defined in the appropriate varchar(xxx) field of the database I obtain this error message:
---------------------------------------------------------------------------
-Dynamic SQL Error
-SQL error code = -303
-arithmetic exception, numeric overflow, or string truncation
-string rigth truncation
---------------------------------------------------------------------------
Moreover, Firebird 2.5.x has deprecated the SQL error codes (without yet eliminate them) preferring the SQL compliant SQLSTATE code variables, but I have not found the corresponding value of SQLCODE number -303.
I would intercept the problem in a Try...ecc. structure or (better) in a trigger procedure of the database to resolve it. Can anyone help me with a skeleton of the appropriate structure/trigger (better using SQLSTATE)?
Thanks!