Query placeholder for column names in insert statement #1628
Answered
by
dougwilson
soysandeep
asked this question in
Q&A
Replies: 1 comment
-
connection.query(`INSERT INTO ${table} (??) VALUES (?)`, [columns, values]) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sidorares
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi team,
I want to create a common method to "insert" data into any table.
I want something like this 👇🏻
I tried running this statement, and it resolves in 👇🏻
which is incorrect syntax. Because column names should not be wrapped in quotes. If I remove quotes from them, it works fine. Has anyone else faced this problem? Need little help.
Beta Was this translation helpful? Give feedback.
All reactions