22 lines
581 B
JavaScript
22 lines
581 B
JavaScript
var connection = require('./connection');
|
|
var queries = require('./queries');
|
|
|
|
function objectToTable(supplyResponse){
|
|
|
|
connection.vnConn.connect(function(conn, cb) {
|
|
var sql = queries.getInsertSupply();
|
|
var insertRows = queries.getValuesSupply(supplyResponse);
|
|
|
|
conn.query(sql,[insertRows],
|
|
function(res, rows, fields) {
|
|
console.log(rows);
|
|
cb();
|
|
}
|
|
);
|
|
}, function(err){
|
|
console.log('ao');
|
|
console.log(err.message);
|
|
});
|
|
}
|
|
|
|
exports.objectToTable = objectToTable; |