This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.1 » doctrine multiple insert
doctrine multiple insert [message #59589] Thu, 28 August 2008 00:21 Go to next message
zf_coder  is currently offline zf_coder
Messages: 4
Registered: May 2008
Location: afsa
Junior Member
Is there any way to create a multiple insert query with Doctrine?
Re: doctrine multiple insert [message #91335 is a reply to message #59589 ] Wed, 13 January 2010 10:26 Go to previous messageGo to next message
Vadim  is currently offline Vadim
Messages: 19
Registered: October 2008
Junior Member
Yeah, I've got the same question! Quite a few of info about this in Internets...
Re: doctrine multiple insert [message #100655 is a reply to message #91335 ] Wed, 09 June 2010 10:30 Go to previous messageGo to next message
guyaloni  is currently offline guyaloni
Messages: 6
Registered: May 2010
Junior Member
I was looking for a solution for quite a while, and couldn't find any.

My problem is that I have a very long array with items to either update or insert, so I would like to generate a multiple REPLACE query.

At the moment I do:
foreach ($info as $infoElement) {
    $o = new globalNews();
    $o->setInfoId($infoElement->id);;
       :
       :
    $o->replace();
}


However, this code might generate many queries (even hundreds!), instead of one.

I am sure there is a solution, somebody can help??? Confused
Re: doctrine multiple insert [message #100658 is a reply to message #59589 ] Wed, 09 June 2010 12:10 Go to previous message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
The Doctrine manual mentions "bulk-insert in MySQL" so I think it would do. Check the manual, or ask on their mailing list.


Remember Palestine
Previous Topic:Tasks not defined after install
Next Topic:Save values from custom form to Database
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software