Originally Posted by
June7
What do you mean by 'cache' - a table? You have this 'cache' table and a table for the Employee and assigned equipment? That is two tables holding equipment info. My point is there should be only one. Juggling data between the 'cache' and employee table subverts the relational database concept. Determining what equipment is assigned/not assigned can be accomplished with queries. A properly structured relational database should not require cut/paste data between tables.
Historically, do you care that an employee had computer A for six months two years ago?
Again, will employee have multiple equipment?
If you insist must do this then INSERT SELECT sql may be best approach to copy data to the 'cache' table then in the employee table simply set the fields equal to Null. Do you also want to go the other way? When assigning equipment, remove from 'cache' table and set values of employee table?
I strongly advise you to reconsider approach to this.
This is like checking out books from a library. Might look into the Lending Library template.