Multiple statements in one prepared statement #1491
Replies: 2 comments 6 replies
-
I never tried multiple statements with prepared statements, not sure if that possible at all. What's the reason you have to use multiple statements? Is it just convenience and and existing being converted to prepared statements or something else? |
Beta Was this translation helpful? Give feedback.
-
I am the lewis... However, I just wanted to express that I had been fighting this issue as well and traced it to a simple query failing an execute for |
Beta Was this translation helpful? Give feedback.
-
Using a prepared statement, the
.execute
call, with multiple statements is giving me a syntax error:Specifically:
But the same code, using the
.query
call instead of the.execute
call, works perfectly fine:Please could someone let me know if this is just me being stupid or if this is a genuine issue?
Is there a fundamental difference between the
.execute
and the.query
calls to a connection if thequery
call can still be 'prepared' by passing in parameters? I was using the.execute
as this is the example provided by the docs on both NPM and Github when regarding prepared statements.Beta Was this translation helpful? Give feedback.
All reactions