Questions tagged as 'trigger'

1
answer

syntax if () in a trigger

I'm having difficulty with the if () syntax in phpmyadmin. I have to create a TRIGGER to insert information into a log when the name of an animal in the animals table is changed. But it's giving syntax error in if (). When I take the if it works...
asked by 19.03.2017 / 18:56
1
answer

IF MariaDB phpmyadmin

I'm trying to create a trigger using phpmyadmin with bank MariaDB but when it arrives in the if line it gives a message:    unrecognized statement type. (near IF) The trigger is this: SET @TOTAL = (SELECT COUNT(*) FROM cliente C WHERE C...
asked by 19.03.2017 / 19:24
1
answer

Trigger to update another table

I have 4 table in my Mysql database. - > companies - > contacts (business addresses) - > bank_data (company bank details) - > partners (company partners) All tables relate to the companies table. In the companies table I have an u...
asked by 20.12.2016 / 14:55
1
answer

How to create a Trigger for a specific column of a table?

I created a trigger for my X table, for the purpose of making a update record that runs on this table. For each update in the X table, modified (old) values are stored in the Z table. PROBLEMATIC : The X table has several...
asked by 20.12.2016 / 12:36
1
answer

ERROR 1242 (21000): Subquery returns more than 1 row

I have a problem with a Trigger (MySQL). I tried to build it myself. The need: I have a system of occurrences where when passing to the stage of closing (stage 4) it verifies that a description was entered in the field descricao_encerra...
asked by 06.12.2016 / 14:26
1
answer

I doubt how to use the IF in a TRIGGER in mysql

Hello! My problem is the following I have two tables, one table called Notes and another called Students . I need to make a comparison with the child_id in the notes table and the id in the students table to only if the < in table in...
asked by 06.07.2016 / 00:31
1
answer

Error writing database log record

I have a database with MySQL. I am doing the log of this database. Most are working, but I can not get the registry id that has been modified. Example : When changing some data, it should be saved in the log id of the record that was cha...
asked by 06.11.2015 / 12:51
0
answers

Create MySQL trigger with input condition

Hello, I am doing a credit card system and I created a column with the types of card using ENUM ('bronze', 'silver', 'gold'), now I want to create a trigger so that when the user enters with the type, the trigger automatically drops the limit, an...
asked by 29.11.2018 / 16:07
0
answers

Trigger for a goal

I want to create a trigger to determine a goal for my hospital system (college project). Every time the doctor performed 10 appointments, his salary would double. However, it does not work. I think I'm not doing it right, so I'd like help struct...
asked by 30.11.2018 / 01:38
0
answers

SQL - Trigger to send email when update is performed

Good morning, I need help on the following: I have a trigger to send email when an update is performed, but I have a problem! Whenever the table has update it is an entire grid that loads and sends emails to all rows that contain the close...
asked by 23.11.2018 / 10:05