nette / database

💾 A database layer with a familiar PDO-like API but much more powerful. Building queries, advanced joins, drivers for MySQL, PostgreSQL, SQLite, MS SQL Server and Oracle.
https://doc.nette.org/database
Other
512 stars 108 forks source link

Inserting results from previous query not possible #247

Closed prkwcz closed 4 years ago

prkwcz commented 4 years ago

I have a script that collects data from different sources and imports it into a MariaDB database. Practically it looks like this:

// Getting all the necessary import sets
$db1Result = $db1->fetchAll("SELECT A, B, C FROM XYZ");

//Importing to the new database
$db2->query("INSERT INTO ZYX", $db1Result);

But then I always get the following error message: Automaticaly detected multi-insert, but values aren't array. If you need try to change mode like "?[and|or|set|values|order]". Mode "values" was used.

In fact, this seems to be a bug in version 3. Here it seems that no ResultSet is accepted as input for the insert anymore.