162 |
|
procedure SetAsShort(Value: short); virtual; |
163 |
|
procedure SetAsString(Value: AnsiString); virtual; |
164 |
|
procedure SetAsVariant(Value: Variant); |
165 |
+ |
procedure SetAsNumeric(Value: Int64; aScale: integer); |
166 |
|
procedure SetIsNull(Value: Boolean); virtual; |
167 |
|
procedure SetIsNullable(Value: Boolean); virtual; |
168 |
|
procedure SetName(aValue: AnsiString); virtual; |
1630 |
|
end; |
1631 |
|
end; |
1632 |
|
|
1633 |
+ |
procedure TSQLDataItem.SetAsNumeric(Value: Int64; aScale: integer); |
1634 |
+ |
begin |
1635 |
+ |
CheckActive; |
1636 |
+ |
Changing; |
1637 |
+ |
if IsNullable then |
1638 |
+ |
IsNull := False; |
1639 |
+ |
|
1640 |
+ |
SQLType := SQL_INT64; |
1641 |
+ |
Scale := aScale; |
1642 |
+ |
DataLength := SizeOf(Int64); |
1643 |
+ |
PInt64(SQLData)^ := Value; |
1644 |
+ |
Changed; |
1645 |
+ |
end; |
1646 |
+ |
|
1647 |
|
procedure TSQLDataItem.SetAsBoolean(AValue: boolean); |
1648 |
|
begin |
1649 |
|
CheckActive; |
1856 |
|
|
1857 |
|
procedure TSQLParam.InternalSetAsString(Value: AnsiString); |
1858 |
|
var b: IBlob; |
1859 |
+ |
dt: TDateTime; |
1860 |
|
begin |
1861 |
|
CheckActive; |
1862 |
|
if IsNullable then |
1891 |
|
SQL_SHORT, |
1892 |
|
SQL_LONG, |
1893 |
|
SQL_INT64: |
1894 |
< |
SetAsInt64(StrToInt(Value)); |
1894 |
> |
SetAsNumeric(AdjustScaleFromCurrency(StrToCurr(Value),GetScale),GetScale); |
1895 |
|
|
1896 |
|
SQL_D_FLOAT, |
1897 |
|
SQL_DOUBLE, |
1899 |
|
SetAsDouble(StrToFloat(Value)); |
1900 |
|
|
1901 |
|
SQL_TIMESTAMP: |
1902 |
< |
SetAsDateTime(StrToDateTime(Value)); |
1902 |
> |
if TryStrToDateTime(Value,dt) then |
1903 |
> |
SetAsDateTime(dt) |
1904 |
> |
else |
1905 |
> |
FIBXSQLVar.SetString(Value); |
1906 |
|
|
1907 |
|
SQL_TYPE_DATE: |
1908 |
< |
SetAsDate(StrToDateTime(Value)); |
1908 |
> |
if TryStrToDateTime(Value,dt) then |
1909 |
> |
SetAsDate(dt) |
1910 |
> |
else |
1911 |
> |
FIBXSQLVar.SetString(Value); |
1912 |
|
|
1913 |
|
SQL_TYPE_TIME: |
1914 |
< |
SetAsTime(StrToDateTime(Value)); |
1914 |
> |
if TryStrToDateTime(Value,dt) then |
1915 |
> |
SetAsTime(dt) |
1916 |
> |
else |
1917 |
> |
FIBXSQLVar.SetString(Value); |
1918 |
|
|
1919 |
|
else |
1920 |
|
IBError(ibxeInvalidDataConversion,[nil]); |