0

How can we insertOrUpadate() bulk data? I have around 60,000 data in bulk so doing a loop insert is very slow and also the bulk data is ever increasing.

Rabinson
  • 91
  • 1
  • 7
  • Could you please show more info? What have you already tried? – Mondini Jun 29 '20 at 13:17
  • Does this answer your question? [Laravel insert or update multiple rows](https://stackoverflow.com/questions/40863015/laravel-insert-or-update-multiple-rows) – Digvijay Jun 29 '20 at 13:17

1 Answers1

0

You can use PHP to prepare MySQL insert statement for inserting multiple rows and run this query as a single insert query.

INSERT INTO tbl_name(a,b,c) VALUES
(1,2,3),
(4,5,6),
(7,8,9);

Please refer SqLBulkInsert post for more detail.

AzimSharp
  • 71
  • 1
  • 1
  • 8