Questions tagged as 'trigger'

1
answer

Error when trying to insert data into a table (Trigger)

I am new here and I come to ask you where is the error in the code (exact match returns ..) since I am eating my head and I still can not find it. It turns out that the Trigger works with the first two inserts in the Call table but in the third...
asked by 13.01.2018 / 14:37
1
answer

Error 1415 in MySQl when creating a trigger

Good afternoon, I am trying to create an alert trigger for lack of products, which throws me the error:    Not allowed to return to result set from a trigger. This is the Query of the trigger that I'm trying to create delimiter $ create...
asked by 30.12.2017 / 21:53
1
answer

extract query value from a variable in mysql

I have a query in a mysql trigger with a query similar to BEGIN set @correos=(select correo from tabla_correos group by correo) END the table has the following structure and information | tabla_correos | ---------------------...
asked by 19.12.2017 / 22:34
1
answer

SQL (ORACLE) How can I insert the current date into a table when inserting a record?

I know it's a Trigger and I have this, but it generates an error: create or replace trigger INSERTAR_HORA AFTER insert on TAREA_SOPORTE for each row begin UPDATE TAREA_SOPORTE SET HORA_GENERADO= CURRENT_TIMESTAMP...
asked by 04.10.2017 / 08:19
2
answers

Create a TRIGGER to insert a record in a table

I have three tables Detalle_Compra , Detalle_Venta e Inventario : CREATE TABLE Detalle_Compra ( Pedido int, Producto int, Cantidad int not null, Precio int, foreign key (Producto) references Productos, foreign key (Pedido) r...
asked by 08.09.2017 / 00:36
2
answers

Trigger SQL Server insert record if certain field is updated

Good afternoon colleagues I have this trigger to insert a record but only if the teststatus field changes, but even if there are other fields that are updated I still insert the record someone knows why create trigger trTestStatusInsertarAct o...
asked by 28.06.2017 / 22:54
1
answer

Error creating trigger with phpmyadmin

I have a problem when creating a trigger in phpmyadmin . This is my syntax in the definition field: DECLARE n_ubicacion VARCHAR(45) DEFAULT ''; IF (OLD.id_ubicacion <> NEW.id_ubicacion) THEN SELECT ubicacion INTO n_ubicaci...
asked by 07.06.2017 / 23:59
1
answer

Update field with a specific condition with trigger

I have the following situation I would like an idea of the condition that could be put in a trigger so that when you insert an ISR422 for example 1.1 the date is updated automatically of the one that has an isr422 = 1, that is, both would have t...
asked by 20.07.2017 / 22:55
1
answer

Trigger in SQL to send email

I need to create a trigger in an SQL table to send an email if the inserted record meets certain conditions. That is, I create the trigger in Tabla1 to send an email to X if in the inserted register the IdCircuito= 53...
asked by 02.02.2017 / 18:58
2
answers

Using "If" inside triggers

I have created a trigger to collect an entered value, relate it to another table and change it. That value can be quite peculiar, so I look for it in two fields and also concatenating it: create or replace TRIGGER "INTER_AGENTE" BEFORE INSERT...
asked by 11.05.2016 / 14:19