Navicat Blog
Schedule Database Tasks using the Navicat Event Designer (Part 5)
Jul 24, 2018 by Robert Gravelle
A database event is a task that runs according to a schedule. Also known as "scheduled events", an event is similar to a cron job in UNIX or a task scheduler task in Windows, except that scheduled events are configured using a database's syntax and/or command-line-interface (CLI). Database events have many uses, such as optimizing database tables, cleaning up logs, archiving data, or generating complex reports during off-peak time.
In previous blogs on this topic, we learned how to configure events using MySQL as our database. Today, we're going to schedule a database task using the Navicat Premium GUI Database Management Tool.
The Navicat Event Designer
In Navicat database management offerings, including Navicat Premium, the Event Designer is the tool for working with events. It's accessible by clicking on the Event button on the main toolbar:
|
Clicking the Event button opens the Event object list in the Object pane. The Object pane toolbar contains three buttons: Design Event, New Event, and Delete Event. If you have no events defined, only the New Event button will be enabled.
Creating a New Event
Click the New Event button to open a new untitled Definition tab:
|
You can enter any valid SQL procedure statement in the Definition tab. This can be a simple statement such as "INSERT INTO tbl_users (first_name,last_name) VALUES('Bob','Jones');", or it can be a compound statement written within BEGIN and END statement delimiters. Compound statements can contain declarations, loops, and other control structure statements.
Note that we don't have to write the CREATE EVENT code, as this is handled by Navicat (as we'll see in the following sections).
Here is an event definition that inserts a new row in the sakila.actor table:
|
Scheduling your Event
Navicat alleviates much of the burden of scheduling events by providing a form for entering scheduling details. The scheduling form is located on the Schedule tab. It supports the adding of Intervals that may comprise either simple or complex time units. Here's a simple example that sets the event to execute 5 minutes after creation:
|
Here's a more complex event schedule that starts in 5 minutes, and runs every five-and-a-half hours for 3 days:
|
Saving an Event
To save an Event, click the Save button on the Even tab. If you like, you can preview the generated SQL on the SQL Preview tab before saving it:
|
Note that the statement is read-only and cannot be edited in the preview.
Adding Comments
You can include comments with your Event on the Comment tab.
It adds them to the CREATE EVENT statement via the COMMENT clause:
|
Deleting an Event
To delete an Event, select it in the Object tab and click the Delete Event button. A warning dialog will ask you to confirm that you wish to delete the Event:
|
Modifying an Event
To modify an Event, select it in the Object tab and click the Design Event button. That will open it in the Event tab.
Navicat Blogs
Blog Archives
- 2024 ( 1 )
- September ( 1 )
- Creating Custom Fields In Navicat BI: Calculated Fields
- Creating Custom Fields In Navicat BI: Custom Sort Orders
- Navicat Premium Lite: the Simple Database Management & Development Tool
- Creating Custom Fields In Navicat BI: Mapped Fields Overview
- Navicat for MySQL 17: Empowering Smarter Business Decisions
- Creating Custom Fields In Navicat BI: Concatenated Fields
- Creating Custom Fields In Navicat BI: Type-Changed Fields
- Navicat BI Tutorial: Chart Design and Dashboards
- Navicat BI Tutorial: Creating a Workspace and Data Source
- Unlock the Power of Data with Navicat BI
- Introducing Navicat Data Modeler 4
- Managing Connections in Navicat 17
- Exploring Table Profiles in Navicat 17
- Create a Data Dictionary in Navicat 17
- Data Profiling in Navicat 17
- Exploring Different Types of Constraints in PostgreSQL
- Navicat 17: A Sneak Peek
- Understanding PostgreSQL Index Types
- Mastering PostgreSQL Rule Syntax
- Understanding PostgreSQL Rules
- Ensuring Data Integrity in PostgreSQL with Check Constraints
- Exploring PostgreSQL's Foreign Data Wrapper and Statistical Functions
- Exploring Advanced PostgreSQL Data Types - Part 2
- Exploring Advanced PostgreSQL Data Types - Part 1
- Why Choose PostgreSQL for Your Next IT Project
- Working with PostgreSQL Materialized Views
- Introduction to PostgreSQL Materialized Views
- Getting Started with SQLite
- Create Custom Metrics In Navicat Monitor 3
- 3 Things You Should Never Store in Your Database
- Some Tips for Securing Your Relational Databases
- Choosing the Right Storage Engine for MySQL Tables
- December ( 1 )
- Configuring Editor Settings in Navicat
- Introduction to Aggregate Queries
- Measuring Query Execution Time in Relational Databases
- Choosing Between Redis and a Traditional Relational Database
- Formatting Dates and Times in Navicat
- Understanding Navicat Connection Profiles
- Some Essential Redis Commands
- Working with JSON Documents in Redis
- What Sets Redis Apart from Other Databases
- Navicat 16.3 Adds Support for Redis Cluster
- Working with Strings in Redis
- Joining Database Tables on Non-Foreign Key Fields
- Expiring Keys in Redis
- Comparing Database Connectivity: Navicat versus Java-based Tools
- Using Hashes in Redis
- A Quick Guide to Redis Sets
- Navicat Wins a DBTA Readers' Choice Award!
- Redis Lists: an Overview
- Working with Keys in Redis
- A Guide to Redis Pub/Sub
- Using Database Aliases
- Redis Data Types
- Getting Started with Redis
- Introducing Navicat for Redis!
- A Guide to MySQL Foreign Key Constraints
- Creating Views in Navicat 16
- Multi-Version Concurrency Control in PostgreSQL
- Setting Query Timeouts in PostgreSQL
- Implement Audit Trail Logging Using Triggers
- Selecting Distinct Values From a Relational Database
- A Quick Guide to Naming Conventions in SQL - Part 3
- A Quick Guide to Naming Conventions in SQL - Part 2
- Viewing PostgreSQL Instance Details in Navicat Monitor 3
- Trace Queries on your PostgreSQL Instances with Navicat Monitor 3
- Monitoring PostgreSQL with Navicat Monitor 3.0
- Navicat Monitor 3.0 is Here!
- A Quick Guide to Naming Conventions in SQL - Part 1
- Supercharging Your Queries with Navicat and ChatGPT
- Correlated Subqueries
- How to Perform a Search and Replace in SQL
- Creating Custom Code Snippets in Navicat 16
- December ( 1 )
- Using SQL Aliases to Simplify Your Queries and Customize the Results
- Navicat 16 and Tablespaces - Part 3
- Navicat 16 and Tablespaces - Part 2
- Navicat 16 and Tablespaces - Part 1
- Update Multiple Tables With One Statement
- Choosing between a Subquery and Join
- Some Disadvantages of Allowing Null Values in Relational Databases
- How to Backup the Database Structure Only in Navicat 16
- Emulating Outer Joins In MySQL
- Understanding SQL Outer Joins
- Storing Enums In a Database
- Choosing a Primary Key - Part 3
- Choosing a Primary Key - Part 2
- Choosing a Primary Key - Part 1
- Exploring Some Prevalent Stored Procedure Myths
- What's New in Navicat 16.1 - Part 4
- Are Stored Procedures an Outdated Tool?
- What's New in Navicat 16.1 - Part 3
- What's New in Navicat 16.1 - Part 2
- What's New in Navicat 16.1 - Part 1
- Find Customers Who Have Purchased More Than n Items Within a Given Timeframe
- Selecting Odd or Even Numbered Rows From a Table
- Exporting MySQL Tables to CSV
- How to Test Insert and Update Statements before Executing Them
- Nested Joins Explained
- Benefits of Third-party Database Management Tools
- Some Top SQL Query Mistakes - Part 5
- Some Top SQL Query Mistakes - Part 4
- Some Top SQL Query Mistakes - Part 3
- Predicates in SQL
- Some Top SQL Query Mistakes - Part 2
- Some Top SQL Query Mistakes - Part 1
- Working with Dates and Times in MySQL - Part 5
- Working with Dates and Times in MySQL - Part 4
- Working with Dates and Times in MySQL - Part 3:
- Working with Dates and Times in MySQL - Part 2
- Working with Dates and Times in MySQL - Part 1
- Some Useful MySQL Numeric Functions
- Writing Exclusive OR Conditions in Relational Databases
- Creating a Test Database with Navicat 16
- A Virtual Tour of the New Standalone Navicat Charts Creator
- Calculating Percentage of Total Rows In SQL
- Navicat 16 Improvements that Maximize Productivity
- December ( 1 )
- Present Your Data More Effectively with Navicat 16
- Improved Collaboration in Navicat 16
- Generating Test Data in Navicat 16
- Storing Ternary Data In MySQL and PostgreSQL
- The Perils of Testing SQL in Production
- Unicode and Non-Unicode String Data Types in SQL Server
- The Purpose of WHERE 1=1 in SQL Statements
- What Is SQLite and How Does It Differ from MySQL?
- Null Values and the SQL Count() Function
- Understanding SQL Server CROSS APPLY and OUTER APPLY Queries - Part 2
- Navicat 16 Preview
- Understanding SQL Server CROSS APPLY and OUTER APPLY Queries - Part 1
- Overview of RDBMS Index Types
- Changing a Column's Data Type In Relational Databases
- Floating Point Rounding Errors in MySQL
- Working With the MySQL Slow Query Log
- Identifying Long Running Queries
- The Impact of Database Indexes On Write Operations
- The Downside of Database Indexing
- What Is Database Monitoring and Why Is It Useful?
- How to Partition a MySQL Table Using Navicat
- Data Type Conversion in MySQL 8
- Get the Maximum Value across Columns
- Introduction to Inverse Indexes
- Object Locking in Relational Database Transactions - Part 3
- Object Locking in Relational Database Transactions - Part 2
- Object Locking in Relational Database Transactions
- Using the SQL COUNT() Function with GROUP BY
- Important SQL Server Functions - Miscellaneous Functions
- Important SQL Server Functions - Date Functions
- Important SQL Server Functions - Numeric Functions
- Important SQL Server Functions - String Utilities
- Iterate over Query Result Sets Using a Cursor
- Copying a Table to a New Table using Pure SQL
- Using Transactions in Stored Procedures to Guard against Data Inconsistencies
- Understanding Database Transactions
- Preventing SQL Injection at the Database Level
- Atomicity in Relational Databases
- Using Group By and Order By in the Same Query
- Calculating Daily Average Date/Time Intervals in MySQL
- Querying Multiple Tables without Joins
- Three Ways to Perform Bulk Inserts
- Joins versus Subqueries: Which Is Faster?
- Database Optimization: an Overview
- What is a Flat File Database?
- December ( 1 )
- Identifying Columns with Missing Values in a Table
- Calculating Average Daily Counts in SQL Server
- Why MySQL (Still) Tops the List of Most Popular Database Platforms
- Preventing the Occurrence of Duplicate Records
- A Guide to Refreshing Test Data
- All About ORDINAL_POSITION
- What Is Ransomware and Why You Should Be Concerned
- Filtering Dates by Month
- Achieving Lightning Fast Query Response Time in MySQL 8
- Preventing All Records from Being Deleted Within a Stored Procedure
- Obtaining Meta-data about Database Table Columns
- Selecting the Second Highest Value from a Table
- Comparing the Semantics of Null, Zero, and Empty String in Relational Databases
- The Many Flavors of the SQL Count() Function
- Storing Formatted Fields in a Database
- Applying Select Distinct to One Column Only
- Splitting Query Results into Ranges
- Using Output Parameters in Stored Procedures
- Hiding Databases From Users in MySQL
- Selecting Rows That Have One Value but Not Another
- Using a Case Statement in a Where Clause
- Troubleshooting Slow Query Execution with Navicat Monitor 2
- Counting String Occurrences in SQL
- MySQL Default Values: Good or Bad? - Part 2: When To Use Them
- MySQL Default Values: Good or Bad? - Part 1: Strict SQL Mode
- Top N Queries by Group
- Is the Database or Application the Best Place for a Custom Function?
- Managing Databases Remotely Using Navicat - Part III
- Managing Databases Remotely Using Navicat - Part II
- Managing Databases Remotely Using Navicat
- Database Structure Synchronization using Navicat 15
- The NULL Value and its Purpose in Relational Database Systems
- Choosing Between VARCHAR and TEXT in MySQL
- Eliminating Repeating Groups In Your Database Tables
- Listing Records Based On Averages
- Selecting All But One Column In MySQL
- How to Tell when it's Time to Rebuild Indexes in Oracle
- Storing Images in MySQL with Navicat
- December ( 1 )
- Navicat Premium 15 - the Most Powerful Yet!
- Perform Full-text Searches in MySQL (Part 3)
- Welcome to Navicat Premium 15! Data Visualization
- Perform Full-text Searches in MySQL (Part 2)
- Perform Full-text Searches in MySQL (Part 1)
- Monitor your SQL Server Instances with Navicat Monitor
- Working with Cursors in MongoDB
- Introducing Navicat Data Modeler 3.0!
- Using the SQL CASE Statement
- Navicat Data Modeler 3 Beta was released today!
- Validating Data using Triggers in MySQL 8
- Using the SQL Limit Keyword
- The SQL Self JOIN
- Managing Multiple Databases from a Single Application
- More Essential SELECT Queries for Every Database Developer's Toolkit
- Connecting to Multiple Databases from a Single Tool
- How to Query across Multiple Databases
- The Between Operator
- Some SELECT Queries You Must Know
- Diagnose Bottlenecks and/or Deadlocks in MySQL 8 using Navicat Monitor
- How the MySQL 8 Performance Schema Helps Diagnose Query Deadlocks
- Using the MySQL Information Schema
- A Few MySQL Tips and Tricks
- Understanding Views in Relational Databases
- Understanding Stored Procedures and Functions in Relational Databases
- Performing Regular Expression Searches in MongoDB
- All about MongoDB's _id Field
- Using Covered Queries in MongoDB
- Performing Database-wide Searches in Navicat Premium
- Create DBRefs in MongoDB
- Relationships in MongoDB
- Deciding between NoSQL and Traditional Relational Databases
- Get a Health and Performance Overview of All your Instances in One Place!
- December ( 1 )
- Optimize Query Performance using the Navicat Query Analyzer (Part 2)
- Optimize Query Performance using the Navicat Query Analyzer (Part 1)
- Receive Notifications for MySQL/MariaDB Issues
- Working with MySQL Logs (Part 3): the Slow Log
- Working with MySQL Logs (Part 2): the Binary Log
- Working with MySQL Logs
- Configure an Instance in Navicat Monitor for MySQL/MariaDB
- Storing Large Files in MongoDB
- New Features in Navicat Monitor 1.8
- Editing User Roles in Navicat for MongoDB
- Introduction to User & Role Management in MongoDB
- Sorting Documents in MongoDB
- Specifying Collation in MongoDB (Part 2)
- Specifying Collation in MongoDB (Part 1)
- Introduction to Views in MongoDB
- Analyzing MongoDB Schemas and Data
- Navicat for MongoDB Grid View Features- Expanding Array Values, Colorizing Cells, and Migrating Data (Part 2)
- Navicat for MongoDB Grid View Commands (Part 1)
- Working with Documents in Navicat for MongoDB
- MongoDB Documents Tutorial
- Working with NoSQL Databases
- Navicat for MongoDB is Here
- Schedule Database Tasks using the Navicat Event Designer (Part 5)
- Starting and Stopping MySQL 8 Events (Part 4)
- Scheduling MySQL 8 Events (Part 3)
- Working with MySQL Events (Part 2)
- An Introduction to Database Events (Part 1)
- Manage MySQL Users in Navicat Premium - Part 4: The Privilege Manager tool
- Manage MySQL Users in Navicat Premium - Part 3: Configuring User Privileges
- Manage MySQL Users in Navicat Premium - Part 2: Creating a New User
- Manage MySQL Users in Navicat Premium - Part 1: Securing the Root
- Navigation Pane Tips and Tricks Part 2: Virtual Grouping and Connection Colouring
- Navigation Pane Tips and Tricks Part 1: Managing Connections
- What to Monitor on SQL Server (Part 2)
- What to Monitor on SQL Server (Part 1)
- MySQL 8 Component Architecture and Error Logging
- Disk Encryption in SQL Server
- Get Row Counts from Multiple Tables and Views in MySQL (Part 3)
- Getting Advanced Row Counts in MySQL (Part 2)
- Getting Row Counts in MySQL (part 1)
- Using Navicat Code Snippets
- Navicat Query Builder: Setting Grouping Criteria (Part 5)
- Navicat Query Builder- Working with Aggregated Output Fields (Part 4)
- Determine How Much Data Has Changed Since Your Last Full Backup on SQL Server
- Navicat Query Builder - Filtering Results (Part 3)
- Eliminating Duplicate Rows using SELECT DISTINCT in MySQL (Part 4)
- Navicat Query Builder- Field Selection (Part 2)
- How to Delete Duplicate Rows with Different IDs in MySQL (Part 3)
- Automate Database Replication with Navicat Premium 12
- Design SELECT Queries using Navicat's Query Builder (Part 1)
- December ( 1 )
- How to Identify Duplicates with Non-unique Keys (Part 2)
- How to Spot and Delete Values with Duplicate Meaning in MySQL (Part 1)
- Create a Model from a Database in Navicat
- Performing Database-wide Searches in Navicat
- Compare two MySQL databases for any differences
- Prepare to Migrate Databases to Amazon Aurora
- Manage your AWS Aurora databases with Navicat
- How to optimize the MySQL Server