I have return the function in mysql.js as :
function myFunction(resourceIdentifiers,callback){
dbconnection.execute( function(err,response) {
response.query('call SP_ExposePricingDetailforUI('
+ resourceIdentifiers + ')'
,function (err, rows, fields) {
console.log(rows);
});
}
);
return rows;
}
And tried to call it at another script file restservice.js as :
mysql.myFunction(resourceIdentifiers , function(err,rows) {
console.log(rows);
}
But I get error as the function myFunction is Undefined.