Subject When is varchar(10) only 7; arithmetic exception, numeric overflow, or string truncation
Author Rick Debay
I have a stored procedure that reads from an external file table.
One of the fields is varchar(10) in the stored procedure and char(10) in
the file.
I am selecting from the stored procedure and inserting in to a table
which has a matching varchar(10) COLLATE ISO8859_1 field.
If a field is empty (LTRIM(column)='') the stored procedure returns NULL
for the field.

I get the error 'arithmetic exception, numeric overflow, or string
truncation' if this varchar(10) field is not empty and it is inserted in
to the other table.

I am completely baffled as the table and stored procedure are defined as
varchar(10). There are other fields defined as varchar and they work
fine. If I use STRLEN it says the source field is ten characters. If I
copy the field from the file and put it explicitly in the insert
('62500445 ' ) it fails. If I trim it so that it's only seven
characters it works.

The version of Firebird is "WI-V6.3.6.5026 Firebird 1.5"