labtech
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
sp_VEventLogs
Parameters
Name
Type
Mode
CID
int
IN
Definition
BEGIN Declare tp varchar(60000); select concat(" Union Select '", REPLACE(replace(trim( TRAILING ':::' FROM replace(`logs`.`SystemLog`,"'","")),":::","' Union Select '"),",,,","','"),"'") FROM `Logs` where computerid=CID and `logs`.`SystemLog` <> "" into @tp; select concat(@tp," Union Select '", REPLACE(replace(trim( TRAILING ':::' FROM replace(`logs`.`SoftwareLog`,"'","")),":::","' Union Select '"),",,,","','"),"'") FROM `Logs` where computerid=CID and `logs`.`SoftwareLog` <> "" into @tp; select concat(@tp," Union Select '", REPLACE(replace(trim( TRAILING ':::' FROM replace(`logs`.`SecurityLog`,"'","")),":::","' Union Select '"),",,,","','"),"'") FROM `Logs` where computerid=CID and `logs`.`SecurityLog` <> "" into @tp; select concat(@tp," Union Select '", REPLACE(replace(trim( TRAILING ':::' FROM replace(`logs`.`ADSLog`,"'","")),":::","' Union Select '"),",,,","','"),"'") FROM `Logs` where computerid=CID and `logs`.`ADSLog` <> "" into @tp; select concat(@tp," Union Select '", REPLACE(replace(trim( TRAILING ':::' FROM replace(`logs`.`FRSLog`,"'","")),":::","' Union Select '"),",,,","','"),"'") FROM `Logs` where computerid=CID and `logs`.`FRSLog` <> "" into @tp; select concat(@tp," Union Select '", REPLACE(replace(trim( TRAILING ':::' FROM replace(`logs`.`DNSLog`,"'","")),":::","' Union Select '"),",,,","','"),"'") FROM `Logs` where computerid=CID and `logs`.`DNSLog` <> "" into @tp; select trim( leading ' Union ' from @tp) into @tp; PREPARE stmt2 FROM @tp; EXECUTE stmt2; DEALLOCATE PREPARE stmt2; set @tp=''; END