Does doctrine 2 support some kind of
“select into”-syntax?
In pure MySQL it would be something like this:
INSERT INTO tbl_temp2 (fld_id)
SELECT tbl_temp1.fld_order_id
FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;
I checked the manual, yet without sucess.
I am refering to Doctrine in version 2.3.1:
In this version you can get the current connection to the database from ORM/EntityManager.
There is only one connection (this was different in Doctrine 1).
Here is what worked for me for the insert-select-task:
There is also an interesting answer here: Using Raw SQL with Doctrine with an code example how to check “raw sql” for PDO compatiblity.