Subject Re: [ib-support] Re: Greetings, and, Fire!
Author Edson T. Marques
----- Original Message -----
From: "alex_vnru" <ded@...>
To: <ib-support@yahoogroups.com>
Sent: Wednesday, May 29, 2002 5:59 AM
Subject: [ib-support] Re: Greetings, and, Fire!

...

> 1. Not referenced to upgrade of server - changes in client application
> caused wrong builded parameter for :STATUSES
> 2. Perhaps incompatibility between client gds32 and server versions if
> only server was upgraded.
> 3. What was previous version of server? Sometimes backup under old
> version and restore under new one solves many problems.
> 4. If STATUS is char type, perhaps one or more records contain one of
> delimiters - ',' or '%'.
> 5. Corrupted table. Are all data according specific :STATUSES string
> which is'nt accessible by this statement accessible by single
> statements

...
Thank you very much "alex_vnru" for you consideration!!!

Everything listed above was tried, but it not work.
I did a step-by-step debugging on my source code (including VCL)
and found that the error ("Numeric overflow or string truncation") is raised
in the
ExecQuery procedure of TIBSQL:

procedure TIBSQL.ExecQuery;
var
fetch_res: ISC_STATUS;
begin
CheckClosed;
if not Prepared then
Prepare;
CheckValidStatement;
case FSQLType of
SQLSelect:
begin
Call(isc_dsql_execute2(StatusVector,
TRHandle,
@FHandle,
Database.SQLDialect,
FSQLParams.AsXSQLDA,
nil), True);
...

When the "Call(isc_dsql_execute2" is executed that exception is raised.

Note:
If the search value is put directly in SQL property of IBQuery instead the
use of parameter
then the query is successful.

The example: 'select * from Table where :Param LIKE '%,' || StringField ||
',%''

1) It works :
...
XXX.SQL.Text := 'select * from Table where ',Value1,Value2,Value3,' LIKE
'%,' || StringField || ',%''
XXX.Open;
...
2) It not works:
...
XXX.Params[0].AsString := ',Value1,Value2,Value3,';
XXX.Open;
...

My tests was done in two different environments:

1) Remote server:
The client: Firebird - WI-V6.2.794 (Firebird 1.0) Win 98
The server: Firebird - WI-V6.2.794 (Firebird 1.0) Linux
2) Local server
The server: Firebird - WI-V6.2.794 (Firebird 1.0) Win98

Both the cases it not works any more.

I'm really appreciate any words about this case.
By now my regards.

Thanks.