Update alphanumeric payment IDs in MySQL every 5 minutes
Recipe ToolsMarketingDatabase
What it does
When the clock triggers every 5 minutes, this automation retrieves rows from the pay0000000 table in MySQL. It increments the alphanumeric ID and value for each row, logs the changes, and writes the updated rows back to MySQL.
Who it's for
Accounting teams who need to auto-increment payment reference numbers in MySQL on a regular schedule.
How teams use this
Auto-increment payment reference numbers
Keep payment IDs in the pay0000000 table current by incrementing them every 5 minutes without manual intervention. The team sees each change logged in the job report.
Extend to multiple payment tables
Add other payment tables to the query so the same increment logic applies to each table. Only include tables that follow the same alphanumeric ID structure.
Adjust the increment interval
Change the clock trigger from 5 minutes to a different schedule, such as hourly or daily, based on when the team needs reference numbers updated.
How it works
- Trigger every 5 minutes. This automation runs on a 5-minute interval to keep payment reference numbers current in the database.
- Select rows from pay0000000 table. Query MySQL to retrieve all rows from the pay0000000 table that need to be incremented and processed.
- Increment ID and value. For each row, slice the alphanumeric ID and value, increment both parts, and log each change to the job report in MySQL.
- Insert updated rows into MySQL. Write the incremented rows back to the pay0000000 table in MySQL to complete the update cycle.