showing an error in a MySQL trigger

0 votes
Sep 27 in Database by Daric
• 500 points
16 views

1 answer to this question.

0 votes

use this code:

CREATE TRIGGER sample_trigger_msg 
    BEFORE INSERT
FOR EACH ROW
    BEGIN
IF(NEW.important_value) < (1*2) THEN
    DECLARE dummy INT;
    SELECT 
           Enter your Message Here!!!
 INTO dummy 
        FROM mytable
      WHERE mytable.id=new.id
END IF;
END;
answered Sep 27 by Omaiz
• 560 points

Related Questions In Database

0 votes
1 answer

Find values in a comma separated string in a MySQL query

You can add commas to the left and ...READ MORE

answered Sep 10, 2018 in Database by darklord
• 6,150 points
2,230 views
0 votes
1 answer

How to do a batch insert in MySQL

You can try out the following query: INSERT ...READ MORE

answered Sep 10, 2018 in Database by darklord
• 6,150 points
292 views
0 votes
1 answer

How to display the queries executed by a particular user in MySQL?

From the version 5.1.7 onward, MySQL allows ...READ MORE

answered Mar 7 in Database by Mishti
• 480 points
42 views
0 votes
1 answer

MySQL query finding values in a comma separated string

To find MySQL query values in a comma-separated ...READ MORE

answered Oct 4 in Database by Daric
• 500 points
12 views
0 votes
1 answer

Types of tables in MySQL

MyISAM is the default table that is ...READ MORE

answered Aug 21, 2018 in Database by CodingByHeart77
• 3,680 points
107 views
0 votes
1 answer

TRIGGERS used in MySQL tables

The following TRIGGERS are allowed in MySQL:  BEFORE ...READ MORE

answered Aug 21, 2018 in Database by CodingByHeart77
• 3,680 points
27 views
0 votes
1 answer

Reset a sequence in Oracle

You can try out something like this create ...READ MORE

answered Sep 24, 2018 in Database by DataKing99
• 8,130 points
369 views
0 votes
1 answer

ACID property in a database

ACID stands for Atomicity, Consistency, Isolation, Durability. It ...READ MORE

answered Oct 8, 2018 in Database by darklord
• 6,150 points
106 views
0 votes
1 answer

How to select the nth row in a SQL database table?

To select nth row type the below ...READ MORE

answered Sep 27 in Database by Omaiz
• 560 points
14 views
0 votes
1 answer

How do I reset a sequence in Oracle?

 If you want to set it to ...READ MORE

answered Sep 27 in Database by Omaiz
• 560 points
15 views