mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-15 23:50:29 +01:00
* Support for ftBoolean and ftWord parameters, based on patch from Ladislav Karrach, bug #14907
git-svn-id: trunk@15232 -
This commit is contained in:
parent
f493a70687
commit
8ff48e9af1
@ -310,6 +310,7 @@ var
|
||||
FloatVal: cdouble;
|
||||
DateVal: SQL_DATE_STRUCT;
|
||||
TimeStampVal: SQL_TIMESTAMP_STRUCT;
|
||||
BoolVal: byte;
|
||||
ColumnSize, BufferLength, StrLenOrInd: SQLINTEGER;
|
||||
CType, SqlType, DecimalDigits:SQLSMALLINT;
|
||||
begin
|
||||
@ -332,7 +333,7 @@ begin
|
||||
StrLenOrInd:=0;
|
||||
|
||||
case AParams[ParamIndex].DataType of
|
||||
ftInteger, ftSmallInt:
|
||||
ftInteger, ftSmallInt, ftWord:
|
||||
begin
|
||||
IntVal:=AParams[ParamIndex].AsInteger;
|
||||
PVal:=@IntVal;
|
||||
@ -401,6 +402,15 @@ begin
|
||||
SqlType:=SQL_TYPE_TIMESTAMP;
|
||||
ColumnSize:=Size;
|
||||
end;
|
||||
ftBoolean:
|
||||
begin
|
||||
BoolVal:=ord(AParams[ParamIndex].AsBoolean);
|
||||
PVal:=@BoolVal;
|
||||
Size:=SizeOf(BoolVal);
|
||||
CType:=SQL_C_BIT;
|
||||
SqlType:=SQL_BIT;
|
||||
ColumnSize:=Size;
|
||||
end
|
||||
else
|
||||
raise EDataBaseError.CreateFmt('Parameter %d is of type %s, which not supported yet',[ParamIndex, Fieldtypenames[AParams[ParamIndex].DataType]]);
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user