x
1
BEGIN
2
3
Declare tp varchar(60000);
4
5
select concat(" Union Select '", REPLACE(replace(trim( TRAILING ':::' FROM replace(`logs`.`SystemLog`,"'","")),":::","' Union Select '"),",,,","','"),"'") FROM `Logs` where computerid=CID and `logs`.`SystemLog` <> "" into @tp;
6
7
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;
8
9
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;
10
11
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;
12
13
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;
14
15
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;
16
17
select trim( leading ' Union ' from @tp) into @tp;
18
19
PREPARE stmt2 FROM @tp;
20
21
EXECUTE stmt2;
22
23
DEALLOCATE PREPARE stmt2;
24
25
set @tp='';
26
27
END