question

newuser-79cdbbe5-168e-447e-a03a-e8afb847d056 avatar image

The query created inside a function doesn't execute

Hi Below is the code

function testID(query_string3) {

var connection3=that_gets_your_connection();

function readMessages (event, context, callback) {

console.log('function triggered')

console.log('Connected!')

connection3.query(query_string3, (err, results, fields) => {

temp=results;

if (err) {

console.error(err)

callback(err)

} else {

console.log(results)

connection3.end()

callback(null, results)

}

})

}

return temp;

}

Please help me to resolve this. Thanks in advance.

alexa skills kitlambda
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers