我正在使用LabVIEW和数据库工具包执行SQL查询,出于语法原因,它一直对此bar之以鼻。我正在通过ODBC连接器使用MySQL。除最后一行外,每行末尾都应有换行符。
LabVIEW抛出的错误是这样的:
可能的原因:
ADO错误:0x80040E14异常
Microsoft OLE DB提供程序中发生
适用于ODBC驱动程序:[MySQL] [ODBC 5.1
驱动程序] [mysqld-5.1.42-community]您
您的SQL语法有错误;
检查对应的手册
您的MySQL服务器版本
在'UPDATE附近使用正确的语法
plc_addresses SET CurrValue ='0.00'
地址='1092';更新plc_a'
在第2行
NI_Database_API.lvlib:连接
Execute.vi-> UpdatePLCAddressesTable.vi-> DevelopSQL.vi
UPDATE plc_addresses SET CurrValue ='0.00'WHERE地址='1132';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1092';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1103';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1105';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1161';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1167';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1129';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1088';
更新plc_addresses SET CurrValue ='0.00'WHERE Address ='1098';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1099';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1100';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1117';
更新plc_addresses SET CurrValue ='0.00'WHERE Address ='1118';
UPDATE plc_addresses SET CurrValue ='0.00'WHERE地址='1106';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1107';
UPDATE plc_addresses SET CurrValue ='0.00'WHERE地址='1108';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1109';
更新plc_addresses SET CurrValue ='0.00'WHERE Address ='1110';
更新plc_addresses SET CurrValue ='0.00'WHERE Address ='1111';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1151';
UPDATE plc_addresses SET CurrValue ='0.00'WHERE地址='1154';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1157';
UPDATE plc_addresses SET CurrValue ='-1023.75'WHERE Address ='1119';
UPDATE plc_addresses SET CurrValue ='-1023.75'WHERE Address ='1120';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1165';
更新plc_addresses SET CurrValue ='0.00'WHERE Address ='1095';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1164';
更新plc_addresses SET CurrValue ='0.00'WHERE Address ='1096';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1097';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1121';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1122';
UPDATE plc_addresses SET CurrValue ='0.00'WHERE地址='1123';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1124';
UPDATE plc_addresses SET CurrValue ='0.00'WHERE地址='1089';
UPDATE plc_addresses SET CurrValue ='0.00'WHERE地址='1101';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1112';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1113';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1114';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1115';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1116';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1091';
更新plc_addresses SET CurrValue ='0.00'WHERE Address ='1141';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1142';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1143';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1139';
更新plc_addresses SET CurrValue ='0.00'WHERE Address ='1153';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1148';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1145';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1150';
UPDATE plc_addresses SET CurrValue ='0.00'WHERE地址='1147';
UPDATE plc_addresses SET CurrValue ='0.00'WHERE地址='1149';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1146';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1104';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1093';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1125';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1126';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1127';
UPDATE plc_addresses SET CurrValue ='0.00'WHERE地址='1094';
更新plc_addresses SET CurrValue ='0.00'WHERE地址='1114';
更新plc_addresses SET CurrValue ='-2522.00'WHERE地址='1114';
最佳答案
我认为您需要将这些作为单独的SQL语句发送,而不是一次发送。
关于mysql - 此SQL查询有什么问题吗?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2150990/