Skip to content
>_ SQL Query Builder

Scheduled Queries

The premium version includes a powerful Query Scheduler that automates SQL query execution. This feature works with both private and global queries and is accessible via the query context menu (the three-dot icon in the tab bar).

Starting a Schedule

  • Save your query
  • Open the query context menu (three-dot icon) and select Schedule Query

WP Data Access - Schedule Query

In the scheduling dialog

  • Set the start date/time
  • Choose the recurrence (e.g., hourly, daily, weekly)
  • Enter notification settings (if you want results sent to your email)
  • Click Schedule to activate

WP Data Access - Schedule Query

Scheduled queries can be configured to send results to an email address. Output formats include CSV, JSON, and XML. Even results from transactional queries (e.g., INSERT, UPDATE) are delivered to your inbox. Errors will also be emailed to you. To use the mail feature, configure your mailbox under Plugin Settings > Mail.

Read more about the data exchange example shown in the screenshot above.

Show active schedules

The query will run at the scheduled time and repeat based on your chosen interval. You can view active schedules for a query by clicking Query Schedules.

WP Data Access - Scheduled Query

Query Parameters

You can run or schedule a query with different parameter values using query parameters. Click the Add Parameters button. In the dialog, define a name and value for each parameter.

WP Data Access - Query Parameters

✨ Example using query parameters in a query

sql
select *
from authors
where email like sqlParam['param_name']

All parameters are sanitized on the server. Queries are executed as prepared SQL statements for safe, secure operations.

Using MySQL Event Scheduler

This only works if you are self-hosted.

If you're using a self-hosted MySQL server, you can use the MySQL Event Scheduler as a free alternative. This feature is not available on most ISP-hosted servers.

✨ Example creating a scheduled MySQL event

sql
CREATE EVENT log_activity_event
ON SCHEDULE EVERY 5 MINUTE
DO
BEGIN
  INSERT INTO log_table (event_name, log_time)
  VALUES ('Scheduled Event Triggered', NOW());
END
/