0 like 0 dislike
522 views
in Education & Reference by | 522 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
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
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,225 questions
1,370 answers
559 comments
2,099 users