/*
CREATE TABLE CTPROD_ATALHO_TITULO (
CODIGO DOUBLE PRECISION NOT NULL,
NOME CHAR(20),
PRIORIDADE DOUBLE PRECISION
);
insert into CTPROD_ATALHO_TITULO (codigo,nome) values (3,'TEST');
*/
db := TZConnection.create(self);
db.Protocol := 'firebird-2.5';
db.User := 'sysdba';
db.Password := 'masterkey';
db.Database := 'c:\dados\store_paf.fdb';
db.HostName := 'maquinareal';
db.LibraryLocation := 'c:\windows\system32\fbclient.dll';
db.Connect;
// dont work - ( I roolback my code to 7.0-beta... its not work )
q:=TZQuery.create(self);
try
q.SQL.Text := 'select * from ctprod_atalho_titulo where codigo=:codigo';
q.Connection := db;
q.ParamByName('codigo').asString := '3';
q.open;
if q.eof then
showMessage('Did not keep any record, but there was...');
finally
q.free;
end;
// work Fine
q:=TZQuery.create(self);
try
q.SQL.Text := 'select * from ctprod_atalho_titulo where codigo=''3'' ';
q.Connection := db;
q.open;
if q.eof=false then
showMessage('Ok this work ...');
finally
q.free;
end;
/*
if I change to -> q.paramByName('codigo').asInteger := 3; its work fine
*/
BUG 7.0.3 - query with params - dont return any record
Moderators: gto, cipto_kh, EgonHugeist
-
- Junior Boarder
- Posts: 30
- Joined: 12.08.2011, 12:42
- Location: Brazil
- Contact:
-
- Junior Boarder
- Posts: 30
- Joined: 12.08.2011, 12:42
- Location: Brazil
- Contact:
Re: BUG 7.0.3 - query with params - dont return any record
Today, I test you sugestion with 7.0.4.... (fbclient.dll 2.5.3 )
The problem continue the same.
The problem continue the same.
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: BUG 7.0.3 - query with params - dont return any record
Hi,
do we really talk about firebird? I'll check your issue..
do we really talk about firebird? I'll check your issue..
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
-
- Junior Boarder
- Posts: 30
- Joined: 12.08.2011, 12:42
- Location: Brazil
- Contact:
Re: BUG 7.0.3 - query with params - dont return any record
Yes, Its Firebird 2.5.3
I Updated to 7.1.2-Stable...
I did the same test and the problem appear too.
Its not solved.
-----------------------------------------
Inspecting Zeos Code, I think that occur in :
GetPlainDriver.isc_dsql_execute2(@FStatusVector, GetTrHandle, @StmtHandle,
GetDialect, FParamSQLData.GetData, SQLData.GetData); //expecting a result
I Updated to 7.1.2-Stable...
I did the same test and the problem appear too.
Its not solved.
-----------------------------------------
Inspecting Zeos Code, I think that occur in :
GetPlainDriver.isc_dsql_execute2(@FStatusVector, GetTrHandle, @StmtHandle,
GetDialect, FParamSQLData.GetData, SQLData.GetData); //expecting a result
Re: BUG 7.0.3 - query with params - dont return any record
@amarildolacerda,
Open \dbc\ZDbcInterbaseUtils.pas and
replace line 2543:
SQL_LONG : PInteger (sqldata)^ := Round(ZStrToFloat(Value) * IBScaleDivisor[sqlscale]); //AVZ
with:
SQL_LONG : PInteger (sqldata)^ := StrToInt(String(Value));
Michal
Open \dbc\ZDbcInterbaseUtils.pas and
replace line 2543:
SQL_LONG : PInteger (sqldata)^ := Round(ZStrToFloat(Value) * IBScaleDivisor[sqlscale]); //AVZ
with:
SQL_LONG : PInteger (sqldata)^ := StrToInt(String(Value));
Michal
-
- Junior Boarder
- Posts: 30
- Joined: 12.08.2011, 12:42
- Location: Brazil
- Contact:
Re: BUG 7.0.3 - query with params - dont return any record
Hello Michel,
I notice that my datatype was DOUBLE (not LONG), then I do this change... Its work ok. (7.1.2-stable).
I think is better to see with AVZ why this dont work...
case SQLCode of
SQL_TEXT : EncodeString(SQL_TEXT, Index, Value);
SQL_VARYING : EncodeString(SQL_VARYING, Index, Value);
// SQL_LONG : PInteger (sqldata)^ := Round(ZStrToFloat(Value) * IBScaleDivisor[sqlscale]); //AVZ -- http://zeoslib.sourceforge.net/viewtopi ... =17&t=3767
SQL_LONG : PInteger (sqldata)^ := StrToInt(String(Value));
SQL_SHORT : PInteger (sqldata)^ := StrToInt(String(Value));
SQL_TYPE_DATE : EncodeString(SQL_DATE, Index, Value);
// SQL_DOUBLE : PDouble (sqldata)^ := ZStrToFloat(Value) * IBScaleDivisor[sqlscale]; //AVZ
SQL_DOUBLE : PDouble (sqldata)^ := ZStrToFloat(Value) ;//* IBScaleDivisor[sqlscale]; //AVZ
// SQL_D_FLOAT,
// SQL_FLOAT : PSingle (sqldata)^ := ZStrToFloat(Value) * IBScaleDivisor[sqlscale]; //AVZ
// SQL_INT64 : PInt64(sqldata)^ := Trunc(ZStrToFloat(Value) * IBScaleDivisor[sqlscale]); //AVZ - INT64 value was not recognized
SQL_D_FLOAT,
SQL_FLOAT : PSingle (sqldata)^ := ZStrToFloat(Value);//* IBScaleDivisor[sqlscale]; //AVZ
SQL_INT64 : PInt64(sqldata)^ := Trunc(ZStrToFloat(Value));//* IBScaleDivisor[sqlscale]); //AVZ - INT64 value was not recognized
I notice that my datatype was DOUBLE (not LONG), then I do this change... Its work ok. (7.1.2-stable).
I think is better to see with AVZ why this dont work...
case SQLCode of
SQL_TEXT : EncodeString(SQL_TEXT, Index, Value);
SQL_VARYING : EncodeString(SQL_VARYING, Index, Value);
// SQL_LONG : PInteger (sqldata)^ := Round(ZStrToFloat(Value) * IBScaleDivisor[sqlscale]); //AVZ -- http://zeoslib.sourceforge.net/viewtopi ... =17&t=3767
SQL_LONG : PInteger (sqldata)^ := StrToInt(String(Value));
SQL_SHORT : PInteger (sqldata)^ := StrToInt(String(Value));
SQL_TYPE_DATE : EncodeString(SQL_DATE, Index, Value);
// SQL_DOUBLE : PDouble (sqldata)^ := ZStrToFloat(Value) * IBScaleDivisor[sqlscale]; //AVZ
SQL_DOUBLE : PDouble (sqldata)^ := ZStrToFloat(Value) ;//* IBScaleDivisor[sqlscale]; //AVZ
// SQL_D_FLOAT,
// SQL_FLOAT : PSingle (sqldata)^ := ZStrToFloat(Value) * IBScaleDivisor[sqlscale]; //AVZ
// SQL_INT64 : PInt64(sqldata)^ := Trunc(ZStrToFloat(Value) * IBScaleDivisor[sqlscale]); //AVZ - INT64 value was not recognized
SQL_D_FLOAT,
SQL_FLOAT : PSingle (sqldata)^ := ZStrToFloat(Value);//* IBScaleDivisor[sqlscale]; //AVZ
SQL_INT64 : PInt64(sqldata)^ := Trunc(ZStrToFloat(Value));//* IBScaleDivisor[sqlscale]); //AVZ - INT64 value was not recognized
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: BUG 7.0.3 - query with params - dont return any record
seems corect to me. I'll apply this patch.amarildolacerda wrote:QL_DOUBLE : PDouble (sqldata)^ := ZStrToFloat(Value) ;//* IBScaleDivisor[sqlscale]; //AVZ
nope i don't think this is right to omit the IBScaleDivisor[sqlscale] for SQL_INT64 but the index of IBScaleDivisor[sqlscale] can be wrong.amarildolacerda wrote:QL_D_FLOAT,
SQL_FLOAT : PSingle (sqldata)^ := ZStrToFloat(Value);//* IBScaleDivisor[sqlscale]; //AVZ
SQL_INT64 : PInt64(sqldata)^ := Trunc(ZStrToFloat(Value));//* IBScaleDivisor[sqlscale]); //AVZ - INT64 value was not recognized
So i'll check the changes now.
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/