|
@@ -121,7 +121,7 @@ type
|
|
implementation
|
|
implementation
|
|
|
|
|
|
uses
|
|
uses
|
|
- strutils;
|
|
|
|
|
|
+ strutils, FmtBCD;
|
|
|
|
|
|
type
|
|
type
|
|
TTm = packed record
|
|
TTm = packed record
|
|
@@ -842,6 +842,8 @@ begin
|
|
begin
|
|
begin
|
|
if VSQLVar^.sqlscale = 0 then
|
|
if VSQLVar^.sqlscale = 0 then
|
|
li := AParams[ParNr].AsLargeInt
|
|
li := AParams[ParNr].AsLargeInt
|
|
|
|
+ else if AParams[ParNr].DataType = ftFMTBcd then
|
|
|
|
+ li := Round(AParams[ParNr].AsFMTBCD * IntPower(10, -VSQLVar^.sqlscale))
|
|
else
|
|
else
|
|
li := Round(AParams[ParNr].AsCurrency * IntPower(10, -VSQLVar^.sqlscale));
|
|
li := Round(AParams[ParNr].AsCurrency * IntPower(10, -VSQLVar^.sqlscale));
|
|
Move(li, VSQLVar^.SQLData^, VSQLVar^.SQLLen);
|
|
Move(li, VSQLVar^.SQLData^, VSQLVar^.SQLLen);
|
|
@@ -863,6 +865,7 @@ var
|
|
VarcharLen : word;
|
|
VarcharLen : word;
|
|
CurrBuff : pchar;
|
|
CurrBuff : pchar;
|
|
c : currency;
|
|
c : currency;
|
|
|
|
+ AFmtBcd : tBCD;
|
|
smalli : smallint;
|
|
smalli : smallint;
|
|
longi : longint;
|
|
longi : longint;
|
|
largei : largeint;
|
|
largei : largeint;
|
|
@@ -920,6 +923,26 @@ begin
|
|
end; {case}
|
|
end; {case}
|
|
Move(c, buffer^ , sizeof(c));
|
|
Move(c, buffer^ , sizeof(c));
|
|
end;
|
|
end;
|
|
|
|
+ ftFMTBcd :
|
|
|
|
+ begin
|
|
|
|
+ case SQLDA^.SQLVar[x].SQLLen of
|
|
|
|
+ 2 : begin
|
|
|
|
+ Move(CurrBuff^, smalli, 2);
|
|
|
|
+ AFmtBCD:= smalli*intpower(10,SQLDA^.SQLVar[x].SQLScale);
|
|
|
|
+ end;
|
|
|
|
+ 4 : begin
|
|
|
|
+ Move(CurrBuff^, longi, 4);
|
|
|
|
+ AFmtBcd := longi*intpower(10,SQLDA^.SQLVar[x].SQLScale);
|
|
|
|
+ end;
|
|
|
|
+ 8 : begin
|
|
|
|
+ Move(CurrBuff^, largei, 8);
|
|
|
|
+ AFmtBcd := largei*intpower(10,SQLDA^.SQLVar[x].SQLScale);
|
|
|
|
+ end;
|
|
|
|
+ else
|
|
|
|
+ Result := False; // Just to be sure, in principle this will never happen
|
|
|
|
+ end; {case}
|
|
|
|
+ Move(AFmtBcd, buffer^ , sizeof(AFmtBcd));
|
|
|
|
+ end;
|
|
ftInteger :
|
|
ftInteger :
|
|
begin
|
|
begin
|
|
FillByte(buffer^,sizeof(Longint),0);
|
|
FillByte(buffer^,sizeof(Longint),0);
|