unidac报ora-12899

laowu1215 2010-03-02 03:18:56
使用unidac 3.00.0.6 版本,连接数据库Oracle Database 11g Enterprise Edition 11.1.0.6.0 ,使用中文字符集:ZHS16GBK,进行SQL insert操作,提示ora-12899,具体如下:
oq2.Close ;
oq2.SQL.Text :='insert into T_CollectJobState (Lsh,Collrq,CollTime,CollectBox,RealRecNum,CollRecNum,headNum,roadNum,unsucNum,NonRec,TestNum,State,jsjh,czyh,pt)';
oq2.SQL.Add('Values(:lsh,:collrq,:colltime,:CollectBOx,:RealRecNum,0,0,0,0,0,0,0,:jsjh,:czyh,1)');
oq2.ParamByName('lsh').AsString :='123456';
oq2.ParamByName('collrq').AsString :='20100301';
oq2.ParamByName('colltime').AsString :='120000';
oq2.ParamByName('CollectBox').AsString :='00001000';
oq2.ParamByName('RealRecNum').Asinteger :=1000;
oq2.ParamByName('jsjh').AsString :='99' ;
oq2.ParamByName('czyh').AsString :='001' ;
oq2.Prepared:=true;
oq2.ExecSQL ;
ORA-12899: value too large for column “T_COLLECTJOBSTATE"."COLLTIME" (actual: 8, maximum: 6)
注:colltime数据库中定义varchar2(6)
请各位大虾帮忙看看,谢谢
...全文
460 12 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
Henry.6 2011-03-22
  • 打赏
  • 举报
回复
升级到3.5看看
Alessandro_ 2011-03-21
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 byteh 的回复:]
如果确定是长度问题,数据库可修改的话就修改表结构吧!

没必要管他是谁的bug
[/Quote]

我在我们那系统也出现这种问题,说超过了最大值,实际值为101,最大值为100

但是我把它最大值修改成120,结果还是报错了,跟踪出来实际值为121,最大值为120.
laowu1215 2010-03-10
  • 打赏
  • 举报
回复
没用的,改了结构又报其他错误
byteh 2010-03-10
  • 打赏
  • 举报
回复
如果确定是长度问题,数据库可修改的话就修改表结构吧!

没必要管他是谁的bug
laowu1215 2010-03-10
  • 打赏
  • 举报
回复
测试UniDAC version 3.00.0.7 ,错误依旧
params的size如下图:
laowu1215 2010-03-06
  • 打赏
  • 举报
回复
New build of UniDAC version 3.00.0.7 is available for download now.
This version includes:
Ability to use Access system database added

Added DetectFieldsOnPrepare parameter for NexusDB ODBC driver

Added ability to send call stack information to the dbMonitor component

Fixed bug with refreshing record when using master/detail relationship

Fixed bug with LocalUpdate in the CachedUpdates mode

Fixed bug with displaying nvarchar2 fields when UseUnicode is true

Fixed bug with getting IndexFieldNames list in design time

Fixed several bugs with getting information about SQLite database using the TUniMetadata component

Fixed bug with processing TableInfo for SQLite

Fixed bug with DBMonitor for C++ Builder 6

这应是BUG,正在期待新的版本下载。。。。。。
laowu1215 2010-03-05
  • 打赏
  • 举报
回复
dbmonitor监控结果:
2010/3/4 17:50:14 0.016 SQL Unprepare: insert into T_CollectJobState (Lsh,Collrq,CollTime,CollectBox,RealRecNum,CollRecNum,headNum,roadNum,unsucNum,NonRec,TestNum,State,jsjh,czyh,pt)
:lsh(WideString[6])='123456'
:collrq(WideString[8])='20100301'
:colltime(WideString[6])='120000'
:CollectBOx(WideString[8])='00001000'
:RealRecNum(Integer)=1000
:jsjh(WideString[2])='99'
:czyh(WideString[3])='001' Complete
2010/3/4 17:50:14 0.000 Disconnect: ***@***.***.***.***:1521:***** Complete
2010/3/4 17:50:14 0.171 Connect: ***@***.***.***.***:1521:***** Complete
2010/3/4 17:50:14 0.000 SQL Prepare: insert into T_CollectJobState (Lsh,Collrq,CollTime,CollectBox,RealRecNum,CollRecNum,headNum,roadNum,unsucNum,NonRec,TestNum,State,jsjh,czyh,pt)
Values(:lsh,:collrq,:colltime,:CollectBOx,:RealRecNum,0,0,0,0,0,0,0,:jsjh,:czyh,1)
:lsh(WideString[6])='123456'
:collrq(WideString[8])='20100301'
:colltime(WideString[6])='120000'
:CollectBOx(WideString[8])='00001000'
:RealRecNum(Integer)=1000
:jsjh(WideString[2])='99'
:czyh(WideString[3])='001' Complete
2010/3/4 17:50:14 1.014 SQL Execute: insert into T_CollectJobState (Lsh,Collrq,CollTime,CollectBox,RealRecNum,CollRecNum,headNum,roadNum,unsucNum,NonRec,TestNum,State,jsjh,czyh,pt)
Values(:lsh,:collrq,:colltime,:CollectBOx,:RealRecNum,0,0,0,0,0,0,0,:jsjh,:czyh,1)
:lsh(WideString[6])='123456'
:collrq(WideString[8])='20100301'
:colltime(WideString[6])='120000'
:CollectBOx(WideString[8])='00001000'
:RealRecNum(Integer)=1000
:jsjh(WideString[2])='99'
:czyh(WideString[3])='001'
starluck 2010-03-03
  • 打赏
  • 举报
回复
应该是字符宽度的问题,

params的size 是多少?
火龙岛主 2010-03-03
  • 打赏
  • 举报
回复
字符集不匹配,注意2010中的string类型均为widestring类型。
laowu1215 2010-03-02
  • 打赏
  • 举报
回复
不是全角,我怀疑是unidac问题,因为我使用UniConnection,直接连接数据库,就报这个错误;
不直接连接oracle,通过oracle的服务连接名连接,没有问题
亮剑_ 2010-03-02
  • 打赏
  • 举报
回复
字段超长,长度为6,实际为8
'120000'里不会有全角字符吧
laowu1215 2010-03-02
  • 打赏
  • 举报
回复
注:使用的delphi2010

5,930

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧