labtech
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
FillAgentComputers
Parameters
Name
Type
Mode
Definition
BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION ROLLBACK; DECLARE EXIT HANDLER FOR SQLWARNING ROLLBACK; START TRANSACTION; DELETE FROM agentcomputers; INSERT INTO agentcomputers() SELECT a.agentID AID, a.groupID GID, sg.ComputerID CID FROM groupdagents a STRAIGHT_JOIN subgroupwchildren sg ON a.GroupID = sg.GroupID UNION SELECT a.agentID AID, a.DriveID GID, a.ComputerID CID FROM agents a WHERE a.CheckAction <> 0 AND a.DriveID = 1 ORDER BY AID, GID, CID; COMMIT; END