Questions tagged as 'trigger'

1
answer

You doubt about trigger to update a field in the same table that triggers it

I have created a trigger that triggers when I modify the value of a record of a table, in this case the number of components that I have in the company. That is, the trigger only allows me to modify this amount if the new value is...
asked by 17.11.2018 / 11:21
1
answer

Do a Trigger updating a field with UPDATE and with DELETE

I have a table called City: CREATE TABLE dbo.Ciudad( Id varchar(36) NOT NULL, DptId varchar(36) NOT NULL, Nombre varchar(40) NOT NULL, Version Timestamp NULL, CreatedAt datetimeoffset NULL DEFAULT...
asked by 26.10.2018 / 21:28
1
answer

Drop table in a MySQL trigger

I would like to know if there is a possibility of having the sentence "DROP TABLE TABLATEMPORAL" using MySQL inside a trigger, since when trying to save the trigger with this sentence I get the following error: "There was an error while apply...
asked by 05.09.2018 / 07:07
0
answers

Backup in oracle db using triggers

I have 2 identical tables, just change the name table1 and table2 , when you enter 3 records in table1 the information in this table must be copied to table 2 and table 1 must be empty again.    The solution must be reached using tri...
asked by 25.07.2018 / 22:09
0
answers

My trigger compiles but does not work [closed]

I have a problem with the trigger to reduce stock. The trigger compiles me and everything but how much I insert data into my table detalle_venta, in the product table it does not reduce the amount. These are my tables: create table producto...
asked by 18.07.2018 / 06:03
1
answer

Error in Trigger "AFTER INSERT ON ..." from MySql

I'm having problems with creating a trigger in mysql, but I do not know why it's causing me an error. The table in which I want to insert once the trigger is activated is the following: CREATE TABLE 'reportes' ( 'id' int(11) NOT NULL, 'tip...
asked by 26.05.2018 / 07:50
0
answers

Doubt about triggers in T-SQL

As far as I understand, when a trigger is executed for the insert event, the new records are added to a virtual table called inserted. When running for a delete event, the deleted records are added to a temporary table named deleted. But w...
asked by 18.06.2018 / 03:19
1
answer

Detect UPDATE with trigger

My table of entradas you have a field precio , the price is assigned from my other table entrada_detalles automatic by trigger with INSERT my problem is that if in table _detalles the price is modified it does n...
asked by 05.05.2018 / 07:38
2
answers

Is it possible to use triggers in the same table in MYSQL?

My problem is that I have a table called students and I want a trigger to trigger when a new student registers, the trigger sends me an email but within the same student table obvious in another field of the same table This is possible? It ge...
asked by 11.05.2018 / 18:16
1
answer

Call sequence in a create table stored in a variable

Hello have the following problem: I have created a sequence in a trigger, and then dynamically instantiate it by create statements of tables in the same trigger. When I try to put NEXTVAL('secuencia') the single quotes tell me the variabl...
asked by 17.01.2018 / 21:08