How to execute multiple queries in one run?
See original GitHub issueI’m facing a problem that I would like to execute multiple queries separated by ‘;’ by a single exec, is that possible?
My test code which is failing looks like:
var query = '' +
'UPDATE "records_raw" ' +
'SET "title" = ? ' +
'WHERE "id" = ?' +
';' +
'UPDATE "records_raw" ' +
'SET "title" = ? ' +
'WHERE "id" = ?' +
';';
var bindings = [
"x", "1",
"y", "2"
];
knex.raw(query, bindings).exec(function(err, result) {
assert.isNotError(err);
});
The error:
Error(cannot insert multiple commands into a prepared statement, ...
Is there a way to disable prepared statements for such queries?
Issue Analytics
- State:
- Created 9 years ago
- Reactions:9
- Comments:40 (20 by maintainers)
Top Results From Across the Web
How to run multiple SQL queries? - Stack Overflow
Simply put three queries one after the other in a .sql file, with semi-colons after each statement, ...
Read more >Including multiple SQL statements in one query - IBM
To run a query with multiple statements, ensure that each statement is separated by a semicolon; then set the DSQEC_RUN_MQ global variable to...
Read more >Use a union query to combine multiple queries into a single ...
On the Create tab, in the Queries group, click Query Design. · On the Design tab, in the Query group, click Union. ·...
Read more >Running multiple queries at the same time. - SQL Studies
One way to do it would be to open multiple query windows, and run them all as close to at the same time...
Read more >I want to execute multiple SQL statements in one console at ...
Yes, just select multiple queries and execute them. +++++++++= To control execution behavior go to settings. In general statements ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any update ? Is it possible now to make multiQuery? If so, using what syntax?
Isn’t this possible by just marking
in the connection block of one’s configuration: e.g.