Skip to content
Advertisement

weekly event select into file with different filenames depending on the variables(MariaDB)

I’ve always been a silent reader here until now. Now I would like to ask for your expertise and post my ver first question here.

I have to achieve the following task on a weekly basis in my MariaDB via Events:

Every Week on Saturday night at midnight, i want to save the results of a certain view in an excel file (xlsx). The filename should be variable depending on the site_id and the current timestamp.

After saving the results into the file I want to cleanup the DB Tables with another Event, but the previous event must be successfully finished as a condition to start the cleanup event.

e.g.filename: viewname_[site_id]_timestamp.xlsx

overall_weekly _3_01082022.xlsx

This is what I have so far:

EVENT 1(saving results into file):

EVENT 2(cleanup):

EVENT 1 must be SUCCESSFULLY finished for event 2 to start. IF event 1 finishes with errors, cleanup must not start.

Many thanks for reading.

Advertisement

Answer

Problem solved: I used 2 tables instead and matched the 2 records together in a third table

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement