The scheduler seems to be running from INFORMATION_SCHEMA.EVENTS but there is no CSV output.
The event scheduler has to automatically produce a csv to pass on the data to another system. It's like integrating 2 systems through the csv, maybe not the optimum way.
The version of MySQL is 5.6.25. What can be the issue?
The event is as below:
DROP EVENT x.tbl_event;
DELIMITER $$
CREATE EVENT x.tbl_event
ON SCHEDULE
EVERY 30 minute
DO BEGIN
select @sent := max(id) FROM x.TBL_COUNT;
select @val := max(submission_id) FROM x.tbl_form;
IF @sent < @val THEN
SET @sql_stmt:= concat("select submission_id, application_type, applicant_name,
applicant_nic,applicant_email,applicant_address_line1, applicant_address_line2,applicant_tel,
applicant_mobile,association_name,association_registrationno,
association_address_line1, association_address_line2,position_applicant,no_members, submission_date, no_of_guests
from x.tbl_form where submission_id>@sent and application_type !=''
INTO OUTFILE 'C:/output", DATE_FORMAT(now(),'%Y-%m-%d_%H%i%s'), ".csv' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'");
PREPARE extrct FROM @sql_stmt;
EXECUTE extrct;
DEALLOCATE PREPARE extrct;
INSERT INTO TBL_COUNT(id, datecreated) VALUES(@val, NOW());
END IF;
END $$
DELIMITER ;
The column last_executed from INFORMATION_SCHEMA.EVENTS seems to indicate that the event gets triggered (and so my code runs), and yet I get no output file.