Reputation: 639
Can anyone help me correct with this code in Lambda Nodejs with multiple input event params.
I've tried already the following but no luck!
ABC = ? WHERE XYZ = ?;', event['ABC', 'XYZ'], function (error, results, fields)
ABC = ? WHERE XYZ = ?;', event['ABC']['XYZ'], function (error, results, fields)
ABC = ? WHERE XYZ = ?;', event['ABC'], event['XYZ'], function (error, results, fields)
Upvotes: 0
Views: 147
Reputation: 35258
The correct syntax that you should be using is below.
By doing this you're providing them as a list.
event['ABC', 'XYZ']
is not valid syntax.
event['ABC']['XYZ']
is looking for a XYZ
key inside of event['ABC']
.
event['ABC'], event['XYZ']
is passing in to many parameters.
ABC = ? WHERE XYZ = ?;', [event['ABC'], event['XYZ']], function (error, results, fields)
Upvotes: 1