Hi,
I'm trying Zeos 7+delphi XE2+Firebird 1.5 and have a problem with parameters in query if is string, only de first character of string is received in firebird.
Example
Stored Procedure
begin
/* Procedure Text */
insert into TEST (VALOR, numero)
values (:VALOR, :numero);
texto=valor;
salida=numero;
suspend;
end
Query:
select *
from sp_test(:usr, :num)
ZQuery1.close;
ZQuery1.ParamByName('usr').AsString:='cfc';
ZQuery1.ParamByName('num').AsInteger:=9876;
ZQuery1.Open;
The query return:
c 9876
The field integer is correct, but the string is truncated.
Thankyou.
[solved] parambyname asstring error
Moderators: gto, EgonHugeist, olehs
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
ism,
no that's terribly wrong. These are the Parameters which he assigns later... You can't quote them because they where handled as string instead of params afterwards.
cfc,
my first question is did you use the svn relases? And if yes then which one? Can you attach the ddl of sp_test too? Just to see how you assign the resultset you want to have..
Michael
no that's terribly wrong. These are the Parameters which he assigns later... You can't quote them because they where handled as string instead of params afterwards.
cfc,
my first question is did you use the svn relases? And if yes then which one? Can you attach the ddl of sp_test too? Just to see how you assign the resultset you want to have..
Michael
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/
I´ using the last version of svn.
The problem is in TZParamsSQLDA.EncodeString line 1801 of ZDbcInterbase6Utils.pas
In line 1824
Move(PAnsiChar(Str)^, sqldata^, sqllen);
I' declare variable s: RawByteString;
and change de line 1824
s := str;
Move(PAnsiChar(s)^, sqldata^, sqllen);
This works, but not what the best solution
The problem is in TZParamsSQLDA.EncodeString line 1801 of ZDbcInterbase6Utils.pas
In line 1824
Move(PAnsiChar(Str)^, sqldata^, sqllen);
I' declare variable s: RawByteString;
and change de line 1824
s := str;
Move(PAnsiChar(s)^, sqldata^, sqllen);
This works, but not what the best solution
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
cfc,
introducing the RawByteString was a good choise! But that solution isn't neutral compiler for all pascal compileres.
Can you switch to my branch? Just look here: http://zeos.firmos.at/viewtopic.php?t=3427
Tell me if the issue is the same. Actually that RawByteString is'n introduced in my branch too. My idea is to add a ZAnsiString = {$IFDEF DELPHI12_UP}RawByteString{$ELSE}AnsiString{$ENDIF} to the ZCompatibility.pas and use them in the whole Dbc-layer, where we need him.
So please test my branch and tell me if your issue is gone...
Michael
introducing the RawByteString was a good choise! But that solution isn't neutral compiler for all pascal compileres.
Can you switch to my branch? Just look here: http://zeos.firmos.at/viewtopic.php?t=3427
Tell me if the issue is the same. Actually that RawByteString is'n introduced in my branch too. My idea is to add a ZAnsiString = {$IFDEF DELPHI12_UP}RawByteString{$ELSE}AnsiString{$ENDIF} to the ZCompatibility.pas and use them in the whole Dbc-layer, where we need him.
So please test my branch and tell me if your issue is gone...
Michael
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/
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
cfc,
thank you for confirmation, that this bug is solved on my branch.
Michael
thank you for confirmation, that this bug is solved on my branch.
Michael
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/