Alain
Alain

Reputation: 1470

How can I fetch the warnings after node-mysql queries

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 ){
      ???
   }

});

Upvotes: 3

Views: 3202

Answers (1)

blue
blue

Reputation: 1949

Execute the query:

SHOW WARNINGS

Here is more on SHOW WARNINGS Syntax

Upvotes: 2

Related Questions