Your query is too large, you have a limit of 128mb and the query is probably handling much more data than that.
Try to find a more efficient way of doing this rather than all at once? On 9 March 2011 16:15, cakephp_rocks <[email protected]> wrote: > i use 2 dbConfigs one conncects to mysql the other connects to SQL > Server > so Detail is Sql Server > and DataDetail is Mysql > > this is my code so far > > any idea how i can do this > i get this error > > is it possiable to do a beforeSave{} to see if the data exists import > new ones > > Allowed memory size of 134217728 bytes exhausted (tried to > allocate 43 bytes) > > function import() { > $this->loadModel('Detail'); > $data = array(); > $batch = $this->Detail->find('all'); > $this->set('batch',$batch); > > > foreach($batch as $b){ > $data[] = array('DataDetail' => array( > 'id' => $b['Detail']['ID'], > 'name' => $b['Detail']['name'] > )); > > } > $this->DataDetail->create(); > if ($this->DataDetail->saveAll($data)){ > $this->redirect(array('action' => 'index')); > $this->Session->setFlash(__('The details has been Imported', > true)); > } > } > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > [email protected] For more options, visit this group > at http://groups.google.com/group/cake-php > -- Kind Regards Stephen http://www.ninjacodermonkey.co.uk -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
