connection.query("call vts_active_tagid('"+RFIDNumber+"','"+Latitude+"','"+Longitude+"','"+datetime+"','"+imeno+"',@passengers,@trip)");
this stored procedure gives one output which contains firstname,phone number and passengerid,how to get those values in the nodejs code
解决方案First thing first, set your mysql to accept multiple statement
set mysql.createConnection({multipleStatements: true});
Do your query
query_str = "CALL sp_whatever(?,?,?,@output); select @output";
con.query(query_str, [param1, param2, param3], function(err,rows){
if(err) throw err;
console.log(rows);
});
Output:
[OkPacket {
fieldCount: 0,
affectedRows: 0,
insertId: 0,
serverStatus: 10,
warningCount: 0,
message: '',
protocol41: true,
changedRows: 0 },
[ RowDataPacket { '@output': -2 } ] ]