SQL Error Code: -802 with Delphi 7 and ZeosLib Rev 113

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
doug4
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: 02.04.2006, 05:43

SQL Error Code: -802 with Delphi 7 and ZeosLib Rev 113

Post by doug4 »

I am using ZeosLib Rev 113 (20061011) in Delphi 7.

I have a table that has a column defined as varchar(130). If the value of the column is a string with more than 83 characters, I get the following error when I try to read the row with the TZQuery component:

"Sql Error: arithmetic exception, numeric overflow, or string truncation. Error Code: -802."

If the length of the value of this field is less than or equal to 83, it works okay.

I have tried the following with both firebird 1.5 and 2.0, the default character set is WIN1252:

Code: Select all

ZConnection1.Protocol := 'firebird-1.5';  // or 'firebird-2.0';
ZConnection1.Properties.Clear;
ZConnection1.Properties.Add('Dialect=3');
ZConnection1.Properties.Add('Codepage=WIN1252');
ZConnection1.Properties.Add('rolename=testuser');
I have also tried "ZConnection1.Properties.Add('lc_ctype=WIN1252');" in place of "ZConnection1.Properties.Add('Codepage=WIN1252');"

How do I fix this problem?

Thank you for your help,
doug4
:?:
doug4
Fresh Boarder
Fresh Boarder
Posts: 12
Joined: 02.04.2006, 05:43

Problem resolved (caused by Firebird RTRIM function)

Post by doug4 »

I was using the Firebird RTRIM function on the varchar(130) column. However, RTRIM apparently can only handle a string up to 80 characters. I have changed RTRIM to TRIM and this has fixed the problem.

-doug4
Post Reply