Questions tagged as 'trigger'

0
answers

Trigger within transaction

I'm using Mysql 5.7 with PHP 7 and I noticed that when I add a simple trigger to a table that is inside a transaction, it takes a very long time to execute the process, it does not happen when it is out of the transaction. / p> Does anyone kno...
asked by 01.04.2018 / 03:39
0
answers

Write too slow after adding Trigger to MYSQL Insert

When I insert this trigger into my database there is a slowness, coming to give this message: Errormessage: Lock wait timeout exceeded; try restarting transaction My trigger is as below, the cod_prod field of the products table is indexe...
asked by 29.03.2018 / 21:19
0
answers

Trigger - Get the Active Directory user

Hello. In the database I have a trigger that saves the user who made the last change in the database. In the old system (still in use) the login with the database was made by AD (active directory) which allowed me to use the function SUSER_SNAME...
asked by 28.03.2018 / 16:02
0
answers

ERROR 1442 - Trigger AFTER INSERT - MySql

My database has the following structure: CREATE TABLE BAIRRO ( BAI_COD INT(4) AUTO_INCREMENT NOT NULL, BAI_NOME VARCHAR(200)NOT NULL, CONSTRAINT PK_BAIRRO PRIMARY KEY(BAI_COD) ); CREATE TABLE PAGAMENTO ( PAG_COD INT(2) AUTO_INCREMEN...
asked by 19.02.2018 / 01:24
2
answers

Why are you giving this error and how do I reverse it?

I have this table: create table lagoa_azul( id_lagoa_azul int not null auto_increment, sem_epi int not null, p1 smallint, p2 smallint, p3 smallint, p4 smallint, p5 smallint, p6 smallint, p7 smallint, p8 smallint, p9 smallint, totOvos int,...
asked by 07.02.2018 / 21:58
3
answers

Create trigger with update setting field through a function

I want to use a trigger to update the field of a table whenever there is an insert in this table. The problem I'm having in the trigger is that the update does not work, it follows the trigger: CREATE TRIGGER descNF ON tabela1 AFTER...
asked by 07.02.2018 / 01:25
0
answers

to trigger Postgre logon

is there any trigger for non-Postgree User login? I need to create a Triger to know which users have accessed the bank, users' station. Thank's     
asked by 26.01.2018 / 17:55
1
answer

Create trigger after update in the table itself and in another

First I have a table: create table alecrim( id_alecrim int not null auto_increment, sem_epi int not null unique, p1 smallint, p2 smallint, p3 smallint, p4 smallint, p5 smallint, p6 smallint, p7 smallint, p8 smallint, p9 smallint, totOvos i...
asked by 01.01.2018 / 14:28
1
answer

Postgresql Regular Expressions

Personal speech, I need some help I'm trying to make a trigger in postgresql that checks if the format of a new data being inserted into a table is in a certain format, in this case the phone format. I need the new phone to be inserted in...
asked by 07.12.2017 / 15:47
2
answers

Error "1241 - Operand should contain 1 column" trigger that checks for duplicates

I'm doing this trigger to check if dados_id and referente_obs exists in the bank table But it returns this error:    1241 - Operand should contain 1 column (s); BEGIN IF (NEW.id_dados and NEW.referente_obs) not in (...
asked by 14.09.2017 / 19:25