

Get in touch

Download Plugin Now
  • Follow
  • Follow
WP Data Access
  • Download
  • Support
  • Features
  • Pricing
  • Documentation
    • Tool Guide
    • App Builder
    • Data Explorer
    • SQL Query Builder
    • Plugin Settings
    • Legacy Tools
    • Remote Connections
a
M
M
  • Download
  • Support
  • Features
  • Pricing
  • Documentation
    • Tool Guide
    • App Builder
    • Data Explorer
    • SQL Query Builder
    • Plugin Settings
    • Legacy Tools
    • Remote Connections
Download Plugin Now

SQL Query Builder

  • Getting Started
  • Tutorials
  • Visual Query Builder
  • Writing queries
  • Data exchange
  • Stored procedures
  • Database triggers
  • Scheduled queries
  • WordPress user ID in SQL
View Categories

Database triggers

The Query Builder allows you to write your own database triggers. Here is a simple example of a database trigger that prevents updates on table dept.
CREATE TRIGGER prevent_updates_on_dept BEFORE UPDATE ON dept
   FOR EACH ROW
   BEGIN
	SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Update failed...';
   END;
/

When the user tries to update a row in table dept with this trigger enabled, the trigger prevents the update and returns error “Update failed…”. You can change this error message to anything you like.

When a users performs this action within a Data Project, WP Data Access adds the custom message to its standard error message:

WP Data Access - Database Triggers (Click to enlarge)
On your development server with debug enabled it looks a little different:
WP Data Access - Database Triggers Debug Enabled
Share This Article :
  • Facebook
  • X
  • LinkedIn
  • Pinterest
Still stuck? How can we help?

How can we help?

Updated on 2025-02-07
Stored proceduresScheduled queries

Submit a Comment Cancel reply

Your email address will not be published. Required fields are marked *

WP Data Access
  • Follow
  • Follow
Quick Links
$

Blogs

$

Tutorials

$

Demos

Get in touch
$

Premium support

$

Free support forum

$

Contact us

Resources


WordPress plugin directory



YouTube tutorials

Copyright © 2025 | All Right Reserves

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok