I have the following schema: CREATE TABLE EPOCA ( ID INT CONSTRAINT PK_EPOCA PRIMARY KEY, NOME VARCHAR(250), DATA_INI DATE CONSTRAINT NN_EPOCA_DATA_INI NOT NULL, …
Tag: triggers
Possible for a MySQL trigger to silently fail?
I’m pulling my hair out trying to debug something. We have large raw tables where ecommerce data gets added to at high. We have summary tables that are populated via insert, update, and delete triggers which are used when users query from our UI. So, those two tables should “match” which is to say if, for example, SUM(revenue) from the
SQL Server: log database changes through generic trigger
Starting from this article, which is creating a trigger to log insert-, update- and delete-statements within the database, I’d like to create a similar trigger which doesn’t require to define the table and its columns. This would us to reduce human errors when dropping or adding columns. I’ve had many issues (hence the extra code compared to the article) but
Error in My SQL Syntax for trigger creation or execution
value_table id auto increment not null unique primary_object_id user_id value group_table id auto increment not null unique primary_object_id 1 2 3 4 5 6 7 I have two tables one stores values(…
After Insert trigger to modify particular value
I have some problems with my trigger. On my transactions table I can’t allow any rows to be inserted which are cancelled. Any transaction can be Scheduled, Done or Cancelled. If you insert a cancelled …
Delete all related rows to user using EF .NET CORE
I have little problem with data delete. Let s assume that I have to delete user and all related rows to this user. I wrote some code in c#, but it takes ages to complete. Here is my some of my code. …
How to successfully reference another table before insert with a trigger
I’m trying to create a trigger to validate if a new entry in the table registraties (registrations) contains a valid MNR (employee number) but I’m getting stuck on the part where I’m referencing the table medewerkers (employees). Could someone help me out? Error message received is ORA-24344: success with compilation error Answer The PL/SQL assignment operator is :=, or select
After update trigger not updating specific row of data in SQL table
Fairly new to SQL here… I am trying to get an ‘after update’ trigger in SQL Server to update a column (rig_ident) whenever another column (rig_id) is updated. rig_ident is found by searching the …
Check attribute in trigger function (PostgreSQL)
I have a task in school which requires me to create a table and a trigger. I don’t really know how to explain it but how can I check if cID is inside the select statement within the trigger function ? …
How to implement AFTER INSERT Trigger in Oracle PL/SQL?
I am trying to implement after insert trigger in PLSQL. The goal is to check if there are multiple (>1) rows having specific status for each client. If so I’d like to rise an exception and roll …