Delphi文档,ISQLCursor.getColumnPrecisionDescription... ...Column type Meaning of precision
---------------- ----------------------------------------------
... ... ... ...
fldBCD Number of significant digits in the BCD values.
(Note that the number of decimal places is returned
by the getColumnScale method.)
... ... ... ...但是SqlExpr单元中的TCustomSQLDataSet.AddFieldDesc(...)中的代码却是....
with FieldDesc do
begin
...
if iFldType in [fldFMTBCD, fldBCD] then
begin
iUnits2 := Abs(iUnits2);
if iUnits1 < iUnits2 then // iUnits1 indicates Oracle
//'usable decimals'
iUnits1 := iUnits2; // ftBCD supports only up to 18-4. If Prec > 14 or Scale > 4,
//make FMTBcd
if (iUnits1 > (MaxBcdPrecision-4)) //!!这里only up to 14位
or (iUnits2 > MaxBcdScale)
or FNumericMapping then
begin
FType := ftFMTBcd;
iFldType := fldFMTBCD;
if (iUnits1 = 38) and (iUnits2 in [0,38]) then
begin
iUnits1 := 32;
iUnits2 := 8;
end;
if iUnits1 > MaxFMTBcdDigits then
iUnits1 := MaxFMTBcdDigits;
end;
end;
end;当我在数据库声明一个字段为numeric(18,4)时,驱动程序装载为
getColumnPrecision返回18,也就是precision为18
getColumnScale返回4,我印象中currency可以处理numeric(18,4)类型的字段,
基于时间和空间性能上的考虑,
本来应该为我创建ftBcd也就是Currency类型的字段,
但是却因为这段代码,使得我的字段变成ftFmtBcd字段我觉得
if (iUnits1 > (MaxBcdPrecision-4)) //!!这里only up to 14位
or (iUnits2 > MaxBcdScale)
or FNumericMapping then
这一句应该为
if (iUnits1 > MaxBcdPrecision) //!!这里only up to 18位
or (iUnits2 > MaxBcdScale)
or FNumericMapping then不知道大家认为如何,大家发表意见啊
---------------- ----------------------------------------------
... ... ... ...
fldBCD Number of significant digits in the BCD values.
(Note that the number of decimal places is returned
by the getColumnScale method.)
... ... ... ...但是SqlExpr单元中的TCustomSQLDataSet.AddFieldDesc(...)中的代码却是....
with FieldDesc do
begin
...
if iFldType in [fldFMTBCD, fldBCD] then
begin
iUnits2 := Abs(iUnits2);
if iUnits1 < iUnits2 then // iUnits1 indicates Oracle
//'usable decimals'
iUnits1 := iUnits2; // ftBCD supports only up to 18-4. If Prec > 14 or Scale > 4,
//make FMTBcd
if (iUnits1 > (MaxBcdPrecision-4)) //!!这里only up to 14位
or (iUnits2 > MaxBcdScale)
or FNumericMapping then
begin
FType := ftFMTBcd;
iFldType := fldFMTBCD;
if (iUnits1 = 38) and (iUnits2 in [0,38]) then
begin
iUnits1 := 32;
iUnits2 := 8;
end;
if iUnits1 > MaxFMTBcdDigits then
iUnits1 := MaxFMTBcdDigits;
end;
end;
end;当我在数据库声明一个字段为numeric(18,4)时,驱动程序装载为
getColumnPrecision返回18,也就是precision为18
getColumnScale返回4,我印象中currency可以处理numeric(18,4)类型的字段,
基于时间和空间性能上的考虑,
本来应该为我创建ftBcd也就是Currency类型的字段,
但是却因为这段代码,使得我的字段变成ftFmtBcd字段我觉得
if (iUnits1 > (MaxBcdPrecision-4)) //!!这里only up to 14位
or (iUnits2 > MaxBcdScale)
or FNumericMapping then
这一句应该为
if (iUnits1 > MaxBcdPrecision) //!!这里only up to 18位
or (iUnits2 > MaxBcdScale)
or FNumericMapping then不知道大家认为如何,大家发表意见啊
解决方案 »
- DLL 打包
- 请教关于BusinessSkinForm左上角[最小化][最大化]怎么改为中文
- 关于Delphi的时间比较
- 关于TStringgrid的问题
- 散分4:窗口排列问题
- 各位老哥:怎么样才能在windows任意目录下创建自己的新文件夹?
- 在delphi中如何简便的将一个数组的各个元素都清零?
- http://www.csdn.net/expert/topic/667/667616.xml?temp=.89349帮我up也好吧,看看吧
- 请问如何改变Application对象创建的隐藏窗口的窗口过程?
- 求解方案:用delphi有没办法向webbrower发送其所需的变量及实现webbrower提交?
- 谁能告诉我这是个什么错误? Excepted '=' but '(' found.
- please help me!
****************
到底是否如你所说,用实际数据测试一下不就知道结果了?
-922337203685477.5808
922337203685477.5807
写入一个numeric(18,4)类型的字段然后关闭再打开再读出得出正确的结果