Questions tagged as 'trigger'

1
answer

MySQL trigger Calculate previous reading difference with current reading

I have a table that is of meter readings, the fields are: id_lecturas int(10) unsigned NOT NULL fk_contadores int(10) unsigned NULL fecha_lecturas datetime NULL valor_lecturas decimal(10,3) NULL diferencia_lecturas decimal(10,3) NULL When a...
asked by 05.11.2017 / 13:19
0
answers

Avoid MySQL error # 1442 when inserting and executing a trigger

CREATE TRIGGER 'user_tel' AFTER INSERT ON 'usuarios' FOR EACH ROW TROW BEGIN DECLARE TEL CHAR(14); DECLARE ID INT; SET TEL = (SELECT telefono FROM usuarios ORDER BY idUsuario DESC LIMIT 1); SET ID = (SELECT idUsuario FROM usuarios ORDER BY i...
asked by 24.03.2018 / 05:40
1
answer

Check value String in SQL

I am creating a trigger in SQL, in which I use the UDFs to invoke a JAVA code. This Java code returns a string, from which I have to check the value to allow an action or not. What SQL function can I use to check the contents of that String in a...
asked by 11.08.2017 / 13:50
0
answers

Trigger, or edit file without permission (no form) Google script

I created a panel using doGet (HTML panel), linked to a spreadsheet. It will be used by supervisors of the company where I work. Depending on which supervisor opens the page, only employees in your sector will appear in a drop-down list. (getEff...
asked by 22.08.2017 / 21:30
1
answer

Trigger to update mysqli php record

Hi, I'm new to the trigger and I have a problem. I have a table with 2 fields | quantity | criteria | and I need that when updating the amount the trigger updates the criterion: example if I update the amount to > 0 then which criterion is up...
asked by 09.07.2017 / 21:58
1
answer

Trigger to calculate hours pl / sql

Good morning everyone and thanks in advance for the time you gave me; My problem is the following one I have to program a trigger in my database that calculates the excess of hours or in its defect the hours of less and skips a warning. I'...
asked by 10.05.2017 / 15:41
2
answers

First registration of a foreign key

Good morning classmates I need to know how I can identify when the first record of a relationship is created, I have 2 related tables the main table has idclase primary key and the second table with its foreign key idclase and primary key id tes...
asked by 31.07.2017 / 18:48
1
answer

Implementation log_changes Mysql ... How do I save the User that I update, insert or delete the record? [closed]

I commented that I am making a log of changes on a table in mysql, I have the trigger that runs every time I update, insert or delete and I also have the table where I save the changes, the sentence with which I save the user which made the chan...
asked by 20.04.2017 / 21:16
0
answers

How to fire a click? after a change event on a select in agularjs on safari [closed]

I have a big problem in safari when i try to fire click event on an input file, after and inside a change event (onchange, ng-change, $ scope.watch ... etc, i tried all). this works fine in chrome, explorer, but not in SAFARI. Here is an example...
asked by 23.09.2016 / 07:41
1
answer

TRIGGER to prevent deleting record with a specific identifier

I'm doing a job with PL / SQL, oracle and sqldeveloper and I have a table to which I want to create a trigger that prevents me from deleting a record that has an id in the field 1. I do not know how to do it.     
asked by 19.05.2016 / 22:54