Questions tagged as 'trigger'

1
answer

Trigger / trigger for oracle

I need to make a triger / trigger so that when someone inserts a value it is modified and another one is inserted. That is, I from a web page will insert a list of products with their ID, but the database to be in oracle does not have auto_in...
asked by 20.05.2018 / 20:40
2
answers

Trigger To Update Stock in MYSQL

How about, I'm doing a tool lending system and I need to update the stock of products every time a product comes in or out of the warehouse, I have not used triggers in mySQL and this is being a bit complicated. This is the Trigger that I hav...
asked by 10.10.2017 / 15:39
1
answer

Avoid entering duplicate data in an Oracle table

I would like to know how to create a Trigger in Oracle that prevents data from duplicating data in a table. To start I have my temporary table: CREATE TABLE temporal( Nombre varchar(50), Tipo varchar(50), Pais varchar(50) ) That when you...
asked by 02.01.2019 / 03:39
1
answer

The BEFORE INSERT trigger works only on a BEFORE UPDATE

I have this trigger ( trigger ) named BEFORE UPDATE in MySQL : CREATE DEFINER='root'@'%' TRIGGER 'CalcularCamposCalculadosActuacionesU' BEFORE INSERT ON 'actuacion' FOR EACH ROW BEGIN SET NEW.TieneFiltrosValidos = (selec...
asked by 09.03.2017 / 11:39
2
answers

Trigger so that it does not update the stock when it is 0

Hi, I want to make a trigger that when the stock of my inventory is less than or equal to 0, it does not allow me to sell more product but it still subtracts them anyway. create trigger NoProductos0a on InventarioProducto for update as decla...
asked by 10.05.2018 / 19:05
2
answers

Update a field in the same table with a trigger

I would like to be able to update a field in the same table where the Trigger is triggered, I have read that when the trigger is triggered the table is blocked and can not be modified but it can be done in another way. CREATE TRI...
asked by 14.02.2017 / 13:57
1
answer

How to count the columns that were updated in a trigger?

I have the following table called Movies : (id int, nombre varchar(50), genero varchar (50), clasificacion char(1), año int) I have this trigger to validate that only one field can be updated at a time in that table. Would there be a...
asked by 22.11.2018 / 06:06
1
answer

MySQL Does not execute well trigger

I have a "trigger before insert" in a table in MySQL, which calculates a time accumulated in the last column of the table through a stored procedure that compares the record that is being inserted with the previous record chronologically ordered...
asked by 10.09.2018 / 22:39
1
answer

How to validate a record in a trigger?

To avoid doing code validation, I would like mysql to insert a detail of a loan to create a trigger to validate if cantidad de artículos in tabla artículos is greater than zero , let me update the table articles otherwise n...
asked by 10.05.2018 / 23:47
1
answer

Copy a value from a Table by a Trigger to another table

I am creating a java app where the user will enter a value and then save said operation so that this value is recorded in a table. What I need is that this value by means of a trigger is copied into a table which does not auto-increment only a p...
asked by 03.04.2018 / 03:37