错误[42000] [MySQL] [ODBC 3.51驱动程序]内存在5332行处耗尽 [英] ERROR [42000] [MySQL][ODBC 3.51 Driver]memory exhausted at 5332 line

查看:106
本文介绍了错误[42000] [MySQL] [ODBC 3.51驱动程序]内存在5332行处耗尽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

foreach (DataRow row in dssetparameter.Tables[0].Rows)
  {
 selectquery += " select ''" + row["itemID"] +"''; as unit_param_id ,''" + row["paramvalue"] + ''" as param_value,''" + row["date_logged"] +"'' as date_logged ,''" + row["date_logged1"] + "'' as OPCdate_logged,''" + row["Quality"] + "'' as param_quality Union ALL" + Environment.NewLine;
  }
  if (selectquery != "")
 {
 selectquery = selectquery.Remove(selectquery.LastIndexOf("Union"));
 insertquery += " insert into " + tablename + "  " + Environment.NewLine;
  insertquery += " (unit_param_id,param_value,date_logged,OPCdate_logged,param_quality)" + Environment.NewLine;
  insertquery += " " + selectquery + " ";
                                if (con2.State == ConnectionState.Closed)
                                    con2.Open();
                                cmd2 = new OdbcCommand(insertquery, con2);
                                    cmd2.CommandTimeout = 500;
                                    cmd2.ExecuteNonQuery();


                                if (con2.State == ConnectionState.Open)
                                    con2.Close();
                            }


我已经编写了此查询,每隔1000毫秒使用线程插入7000行.但是当我执行此查询时,它将被抛出异常,原因是

"


i have write this query inserting the 7000 row at every 1000 millisecond using threading .But when i will be excute this query it will be thrown exception as

"

ERROR [42000] [MySQL][ODBC 3.51 Driver][mysqld-6.0.11-alpha-community]memory exhausted near ''5332' as unit_param_id ,'' as param_value,'' as date_logged ,'' as OPCdate_logg' at line 5334


行 "
请帮助我
在此先感谢..........


"
please help me
thanks in advance..........

推荐答案

首先切换到^ ]驱动程序. MySql Odbc v 3.51是一个非常旧的驱动程序.

然后重新考虑有关INSERT ... SELECT语句的代码.
First switch to MySql Connector/Net[^] driver. The MySql Odbc v 3.51 is a very old driver.

Then rethink the code about the INSERT ... SELECT statement.


这篇关于错误[42000] [MySQL] [ODBC 3.51驱动程序]内存在5332行处耗尽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆