I need to batch update in a table, I have an object named $data
as the example below:
Array
(
[0] => stdClass Object
(
[nota] =>
[frequencia] =>
[temaTcc] =>
[idNotaFreq] => 3416a75f4cea9109507cacd8e2f2aefc
)
[1] => stdClass Object
(
[nota] =>
[frequencia] =>
[temaTcc] =>
[idNotaFreq] => a1d0c6e83f027327d8461063f4ac58a6
)
[2] => stdClass Object
(
[nota] =>
[frequencia] =>
[temaTcc] =>
[idNotaFreq] => 17e62166fc8586dfa4d1bc0e1742c08b
)
)
I call the update_batch()
as follows:
return $this->db->update_batch($table, $data, 'md5(idNotaFreq)');
Error message I receive:
One or more rows sent for batch update is missing the specified index. Filename: C: /xampp/htdocs/cert_emissao/system/database/DB_query_builder.php Line Number: 2028
Note: In the example I left only 3 positions of the object, and I know that they have some empty attributes, but I tried to fill in all of them and the problem persisted. The objects I send to update
have between 10 and 14 total positions, and chances are some attributes will be empty as above ) or may all be filled. However, I always have the key filled idNotaFreq
which I believe to be what can not be empty. The table name is nota_freq
(MySQL).