Questions tagged as 'trigger'

0
answers

TRIGGER with error # 1064 on mysql

I have this code for a trigger on mysql and i looked for this type of error and ways to correct it but still do not work. below is the code. CREATE TRIGGER 'tr_worklog' BEFORE INSERT ON 'total_worklog_bogota' FOR EACH ROW BEGIN IF (NOT...
asked by 25.09.2018 / 18:35
1
answer

How is a trigger that adds a row and that is assigned in a column?

Well the fact is that I want to make a sum of a row and that this is saved in a field here of how I carry the table: the case is that when entering: UPDATE enero SET totalgastos= enero.alimentacion+enero.transporte+enero.ser...
asked by 24.09.2018 / 03:03
0
answers

MySQL - trigger to generate an md5 code

I have been trying to use a trigger to update a record after I entered it, the problem is that the following code does not work for me: CREATE TRIGGER 'test_trigger' AFTER INSERT ON 'chat_test_trigger' FOR EACH ROW UPDATE chat_test_trigger SE...
asked by 03.10.2018 / 17:43
0
answers

how can I make a trigger for 2 tables?

I'm thinking about making triggers that save when there is insert in 2 tables, I mean I have this table: --- tbl_cliente --- Cod_Cli mail password First name Surname age birth date and I have this other table --- tbl_adm...
asked by 09.10.2018 / 16:59
0
answers

Fill logbook table with an INSERT TRIGGER after saving in the table bagones

Create the trigger but when the insert is executed it gives the following error: TRIGGER Code DROP TRIGGER IF EXISTS 'bin_bagon_ins'; CREATE DEFINER = 'root' @ 'localhost' TRIGGER 'bin_bagon_ins' AFTER INSERT ON 'bagon' FOR...
asked by 12.09.2018 / 21:32
0
answers

How to audit the name of the affected column, the previous value and the new value with a trigger dynamically?

I have a table to audit: Tabla Tabla ID, col1, col2, col3, col4... col500 If you make update in Tabla my trigger is triggered which inserts in the table Tabla_audit Tabla_audit ID, ColmunaAfectada, ValorAnterio...
asked by 30.08.2018 / 02:11
1
answer

Creating a trigger SQL server 2008 ERROR: The object does not exist

The following trigger marks me the following error when executing it:    Msg 8197, Level 16, State 4, Procedure   InsertHystoryOfOrderHasProfiles, Line 1 The object   'dbo.OrderHasProfilesOfPayments' does not exist or is invalid for th...
asked by 13.08.2018 / 20:32
1
answer

Create a trigger to copy value from one field to another field within the same table in mysql

Good help please, if someone could give me an example to copy the value of one field to another field of the same table, when I update the first field. thanks     
asked by 19.08.2018 / 05:04
1
answer

Error creating triggers with dbvisualizer

I am using the version of DbVisualizer Pro 9.5.6 and I am running the following sql command to create triggers . CREATE OR REPLACE TRIGGER "MYDB"."TG_T01_01" BEFORE INSERT ON T01 FOR EACH ROW BEGIN :NEW.FECALT_01...
asked by 10.08.2018 / 06:45
0
answers

How to create a Trigger in a table that is triggered when modifying the data and that reports the primary key of the modified field?

I would like to know how I can return using a trigger the value of the primary key of a field when updating. I'm working with SqlServer.     
asked by 22.07.2018 / 19:49