DataBase Bulk Update

Re: DataBase Bulk Update

by Justin Hunt -
Number of replies: 0
Picture of Particularly helpful Moodlers Picture of Plugin developers

You might first construct a query to check for records that exist, then do a bulk insert as described on this page for those that don't exist..

https://docs.moodle.org/dev/Data_manipulation_API

For the others you might have to do it one by one, or create a temporary table and do it by referencing that. If this is a plugin you could simplify it by maintaining a table just for this people, and just clear it before you start each job.,