Questions tagged as 'trigger'

1
answer

Create trigger between tables

I'm doing a job here and I came across a problem, our system is a home automation system using java and mysql . We created two tables for logs , the first one saving the device, user and the exact date that was turned on or...
asked by 15.07.2017 / 16:11
0
answers

Create trigger in oracle

I have three tables: Usuario , Lembrete and Lembrete_Usuario in Oracle. I'm trying to create a trigger that when I insert it into the User table and in the Reminder, take the User and Reminder ids, and put it in the User_Reco...
asked by 18.06.2017 / 20:09
0
answers

Create record trigger

Trigger that when you delete a record from any of the dimension tables generated by the template you created, delete all linked records in CUBO_EMPESTIMO. SQL Database. Attached Image Template link     
asked by 07.06.2017 / 15:23
1
answer

Error executing SQL "Create Trigger ..." within a C #

Goal: Run a create trigger script using a string inside C #. Problem 1: Table not found (because the script does not indicate in which Table to create the trigger). Attempt2: Start the string with "Create Trigger on [dbo]. [Table]". Pro...
asked by 14.06.2017 / 14:23
2
answers

Function with insert according to a select that returns a list of ID's - Postgresql

I need to make a after insert trigger that calls a function that takes the last record inserted in a certain table and inserts the ID of that last record into another table according to a select that returns several ID's. EX: tb_...
asked by 07.06.2017 / 19:53
2
answers

Trigger for table optimization

I'm trying to create a trigger that runs the OPTIMIZE command of MySQL. In short, I have a table A and I created a table B that will write a datetime where this value will be updated every time the table A receives the OPTIM...
asked by 19.05.2017 / 20:01
2
answers

How to leave negative number according to condition - Mysql Trigger

I have a lc_movimento table with the fields: id , tipo and valor . I need the valor field to have the minus sign if is equal to tipo every time I enter and update. How can I do this?     
asked by 22.04.2017 / 06:41
0
answers

Triger after update as a solution to debit credit securely

I need to make an interface that guarantees the integrity of the customer's credit. In PHP, when we use LOCK explicitly in the PDO, with LOCK TABLES, if there is an inconsistency, when the same client object is in several processes relating even...
asked by 21.02.2017 / 20:18
1
answer

Transfer table columns in JSON in Postgres Trigger

I am creating a trigger in Postgres and would like to turn all columns into JSON to insert into a single column of the 'LOG' table, I would like to for example 'OLD. *' in JSON and add it in the oldvalue column 'of the LOG table. create table...
asked by 12.12.2016 / 19:34
0
answers

Trigger mysql - error?

Hello, this is the first time I'm using triggers and I do not know how to solve a bug I'm having and a problem I do not know how to do. I want to make a trigger for when an inserted date (start and end date) is superimposed between a date tha...
asked by 01.12.2016 / 22:01