Fun at zangOOr Click Here
0 like 0 dislike
545 views
in Education & Reference by

1 Answer

0 like 0 dislike
by
 
Best answer

DELIMITER $$
CREATE PROCEDURE my_procedure()
BEGIN
SET @OutputPath := '/var/www/html/tmp';
SET @fullOutputPath := CONCAT(@OutputPath,'/',now());
set @q1 := concat("SELECT * INTO OUTFILE '",@fullOutputPath,"' FROM my_table");
prepare s1 from @q1;
execute s1;deallocate prepare s1;
END $$
DELIMITER ;

And Call  my_procedure() in trigger

DELIMITER $$
CREATE
TRIGGER my_trigger
AFTER INSERT ON my_table2
FOR EACH ROW
BEGIN
CALL my_procedure();
END
$$
DELIMITER;

 

Related questions

0 like 0 dislike
1 answer 1.5k views
3 like 0 dislike
1 answer 897 views
2 like 0 dislike
3 answers 17.3k views
0 like 0 dislike
1 answer 983 views
1 like 0 dislike
1 answer 3.4k views
0 like 0 dislike
1 answer 115 views
0 like 0 dislike
1 answer 111 views

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

...