Welcome Guest, Not a member yet? Register   Sign In
insert_batch throwing random () between two records.
#1

[eluser]Doulos[/eluser]
Description of the Problem: I'm doing a Batch insert every 100 records reading from a text file that contains about half a million lines. Randomly after line 440,650 the batch insert operation is putting an empty set of () for no apparent reason. Below is the SQL Output generated by the insert_batch command, the piece of model code doing the input (It's in a While(!feof) loop)) and the 2 lines it's happening between from the text file. I'd love any suggestions.
Code:
//insert_batch output
('','','TAMPA','00000000',0,0,0,0,0,0,'000001','','','','54','','00','00','00','00','00
','','','','2009090906573283NPAN02','WC','000013','','562422696-00000001','00','37','2','FL','33619'), (), ('','','TAMPA','00000000',0,0,0,0,0,0,'000002','','','','54','','00','00','00','00','00
','','','','2009090906573283NPAN02','WC','000013','','562422696-00000001','00','37','2','FL','33619'),

//Model
if ($x == 99){
    $this->db->insert_batch('toprocess', $lines);
    $x = 0;
    $lines = array();
}else{
    $x++;
}

//Empty Set Happens between these 2 Records in the Text File
2|000013||||37||00||562422696-00000001|||||WC||2009090906573283NPAN02|||TAMPA|FL|33619|000001|00000000|54|00|00|00|00|00
2|000013||||37||00||562422696-00000001|||||WC||2009090906573283NPAN02|||TAMPA|FL|33619|000002|00000000|54|00|00|00|00|00
#2

[eluser]Doulos[/eluser]
Delete this. I found a Bug in my own code that was adding an Array Element that wasn't in the insert record.

Sorry!




Theme © iAndrew 2016 - Forum software by © MyBB