Claim your Biolink Click Here
0 like 0 dislike
849 views
in Education & Reference by | 849 views

1 Answer

0 like 0 dislike
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;

 

by

Related questions

0 like 0 dislike
1 answer
3 like 0 dislike
1 answer
2 like 0 dislike
3 answers
0 like 0 dislike
1 answer
1 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Sep 15, 2017 in Education & Reference by Krish (1.1k points) | 344 views
0 like 0 dislike
1 answer

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

1,312 questions
1,473 answers
569 comments
4,809 users