Skip to content
Advertisement

Tag: triggers

How to create a trigger for this situation?

I have a problem inserting values into a Class table. I want to write a trigger to prevent happening “an instructor teaches in different class_Id at the same time”. How can I do this? This is the trigger which I’ve created: Answer Use inserted and JOIN to the Class table. Check for existence of rows in table that matches your

MySQL trigger not functioning correctly

I currently working my AWS RDS MySQL through R notebook. I have a table like this: With a trigger like this I could create table and trigger without problems; however, when I insert something like this The insertion was successful but I would get an instance of fruit with ‘C’, instead of ‘A’ Wonder if anyone has some insights, thank!

How to create a trigger which will auto create sequence ID

I have been trying to implement the logic. But as only basic knowledge on SQL. I have a below following table I have following data in it I need to write some trigger as soon as the insert is performed depending upon createddate a sequence should be automatically inserted to sequence column for respective record. Expected output : The sequence

PostgreSQL: Trigger INSERT INTO SELECT from other table

I’m trying to create a trigger that will add a new row processed entry to a destination table each time a new row is created in the source table. Step 1 Create destination table: Step 2 Create trigger function: ** The Select query inside function work normally when single running. Step 3 Create trigger: The problem is that Trigger does

PL/SQL table mutation and trigger Format

I just started with triggers, I want the trigger to give me the msg error if the new tauxHoraire is 50% greater than the current tauxHoraire (so *1.5 >). The trigger compiles but I’m getting ORA-04091: table name is mutating, trigger/function may not see it. There might a problem in how I wrote it. Or is the problem somewhere else?

How to insert data into table even if trigger fails?

Oracle 11.1 I have custom logging table where I insert data: I have a trigger that runs on a specific table which does some checkings. My problem is: when the trigger fails, I want to be able to log some data into the log_table. Trigger: The following code doesn’t work. I tried to use EXECUTE IMMEDIATE maybe to force it,

Advertisement