Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
My stored procedure cannot executed inside connection.query, even if no error displaying in the application. What is the issue? I use following code in node js.
var mysql = require('mysql');

var db_local_config = {

    host     : 'your_host_ip',
    user     : 'userName',
    password : 'password',
    database : 'database'
};

var conLocalPool = mysql.createPool(db_local_config);


str = "call my_stored_procedure(parameters)";
            conLocalPool.getConnection(function (err, con) {
                if (err)
                    console.log('Error while performing Query.' + err);
                

                con.query(str, function (err, rows, fields) {
                    if (err)
                        console.log('Error while performing Query.' + err);
                    else {
                        console.log(rows[0]);
        
                    }
                    //con.destroy();
                    //con.end();
                    //con.release();
                });
                //mysqlPool.destroy();
                //con.end();
                
                

            });
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900