How can I fetch the warnings after node-mysql queries

夙愿已清 提交于 2020-03-03 11:49:29

问题


How can I fetch the corresponding warning identified after the query execution as in:

connection.query( squery, function(err, rows){
   ... 
   // search for OkPacket in 2 dimension array
   var warningCounter = okPacket.warningCount;
   if ( warningCounter > 0 ){
      ???
   }

});

回答1:


Execute the query:

SHOW WARNINGS

Here is more on SHOW WARNINGS Syntax



来源:https://stackoverflow.com/questions/22962635/how-can-i-fetch-the-warnings-after-node-mysql-queries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!