mysql错误“multiple-step operation generated error.....”究竟能不能解决啊

gbhsky 2009-12-22 12:15:17
我在程序里向某个数据表插入一个空记录,就出现了“multiple-step operation generated error check each status value”的错误,我用的mysql5.0,后来换成5.1问题依旧,请问这个问题究竟怎么解决啊
...全文
100 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
gbhsky 2009-12-23
  • 打赏
  • 举报
回复
不是字段类型造成的,昨天傍晚这个错误莫名奇妙的解决了,但我依然不清楚原因。我前面给出的代码概述是将calculate放到一个循环中,因为我有很多测量传感器,而这些传感器的通信和解析方式是一样的。原来大概是这样的:
for i:=0 to NodeCount-1 do
begin
NodeNum:= i;
calculate;
ds.insert;
...
end;

后来我改成这样:
for i:=0 to NodeCount-1 do
begin
NodeNum:=i;
calculate;
end;

for i:=0 to NodeCount-1 do
begin
ds.insert;
...
end;

也就是说原来我对每一个传感器(节点)计算完了马上放到dataset中,这时就会出前述的错误。后来我改成先把所有的节点都计算完,然后再将所有节点数据存入dataset就没问题了。
关键就在ds.insert这句上面,实际上我的calculate根本不涉及到任何的数据库操作或者引用数据库对象,所以我真的看不出问题出在哪里
阿_布 2009-12-22
  • 打赏
  • 举报
回复
show create table tablename 看一下你的字段是否允许为空。
要不出现这个错误,set sql_mode='';
gbhsky 2009-12-22
  • 打赏
  • 举报
回复
自己顶,谁能给我解答这个问题啊
jiuchang 2009-12-22
  • 打赏
  • 举报
回复
Without looking at your code I can tell you that you are getting this error because you are trying to put a string into a VARCHAR field that is too long. So, for example you are trying to put a 60 char string into a VARCHAR(50) field.

Thanks your explanation. I it helped me solve the same error

这是别人遇到这个问题时的答复,解决了这个问题,你看看是不是字段类型没有设置好,长度有冲突
gbhsky 2009-12-22
  • 打赏
  • 举报
回复
是这样的,我这是一个上位机程序,任务是和下面的传感器进行通信,取得下面的数据,并做适当的变换变成直观的数据后存入数据库,我的目的是使用dataset来离线存储,然后隔一段时间post回数据库更新,具体代码大概如下:
。。。
ds.insert;
ds.fieldbyname('nodenum').asinteger := a
。。。。

结果问题就出在ds.insert这句上,原来我没加数据的变换部分(一个函数calculate)时没有错误,加上了这个函数之后就不行了,如下:
。。。
calculate
ds.insert;
ds.fieldbyname('nodenum').asinteger := a
。。。。
ACMAIN_CHM 2009-12-22
  • 打赏
  • 举报
回复
那你的代码是什么?

rs.fields('xxx').value = ?? 是这种方式?

建议你能说明,否则别人只能靠猜来帮助你分析问题。这样效率会很差。
gbhsky 2009-12-22
  • 打赏
  • 举报
回复
我使用adodataset的insert方法,在insert后就出现上述错误。但是在以前是成功过的,是在我修改了一些代码后出现的这个问题,而修改的代码和数据库部分的代码毫无关系
ACMAIN_CHM 2009-12-22
  • 打赏
  • 举报
回复
你的SQL语句是什么?
gbhsky 2009-12-22
  • 打赏
  • 举报
回复
我也注意到这个问题了,但是我的字段都是有默认值设置的啊
“要不出现这个错误,set sql_mode=''”这句话没理解,呵呵
Delphi 7.1 Update Release Notes=======================================================This file contains important supplemental and late-breakinginformation that may not appear in the main productdocumentation, and supersedes information contained in otherdocuments, including previously installed release notes.Borland recommends that you read this file in its entirety.NOTE: If you are updating a localized version of Delphi 7, visit the Borland Registered User web site to obtain a localized readme file that may contain important late- breaking information not included in this readme file.IMPORTANT: Delphi must be closed before installing this update. =====================================================CONTENTS * INSTALLING THIS UPDATE * UPDATING LOCALIZED VERSIONS OF DELPHI 7 * KNOWN ISSUES * ISSUES ADDRESSED BY THIS UPDATE - IDE - CORE DATABASE - DATASNAP - DBGO (ADO COMPONENTS) - dbExpress - dbExpress COMPONENTS AND DB VCL - dbExpress CORE DRIVER AND METADATA - dbExpress VENDOR ISSUES - dbExpress CERTIFICATION - WEB SNAP - ACTIVEX - COMPILER - RTL - VCL - THIRD PARTY - BOLD FOR DELPHI * VERIFYING THAT THE UPDATE WAS SUCCESSFUL * FILES INSTALLED BY THIS UPDATE =======================================================INSTALLING THIS UPDATE* This update can not be applied to Delphi 7 Architect Trial version. * This update can not be removed after it is installed.* You will need the original Delphi 7 installation CD available to install this update.* To install this update from the CD, insert the CD, and launch the d7_ent_upd1.exe file appropriate for your locale.* To install this update from the Web, double-click the self-executing installation file and follow the prompts. * The Delphi 7 documentation PDF files are available on the update CD.========================================================UPDATING LOCALIZED VERSIONS OF DELPHI 7* This update can be applied only to the English version of Delphi 7. There are separate updates for the German, French and Japanese ver

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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