Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
2 answers
5k views

script all triggers in a database

I have a few databases involved in replication as subscribers and they have triggers and are used by a different set of applications. Every time I need to reinitialise those database I need to script ...
Marcello Miorelli's user avatar
1 vote
2 answers
5k views

What's the difference between a cursor and a trigger? [closed]

I'm triying to understand why use a Cursosr or really how they work (I'm a newbie). I don't really find a clear purpose for using it. How does it compare to a trigger?
Matias Ruiz's user avatar
2 votes
1 answer
182 views

Cursor That Executes a Proc that Creates An Audit Trigger

So, I've been battling this thing for a couple of hours and figured I would reach out for a little but of help. I need to create an audit trigger on all tables of a database (This audit trigger works ...
user119362's user avatar
1 vote
1 answer
320 views

Dynamically records not getting to cursor in trigger

I am using cursor in trigger in MySQL. I want to get records of recently added id. I am using this: CREATE DEFINER=`root`@`localhost` TRIGGER `calculate_property_ratings` AFTER INSERT ON `node` FOR ...
Devidas Kadam's user avatar
0 votes
3 answers
4k views

How to get currently inserted rows and sum them within Mysql trigger before insert

I have a mysql trigger that fires BEFORE INSERT. My php application is inserting multiple rows at once like so INSERT INTO table1(id,name,price) VALUES(1,'LH32400', 1990),(2,LH32401,2000); The idea ...
berkesh's user avatar
6 votes
2 answers
1k views

SQL Server using index scan instead of seek when updating a view that has an INSTEAD OF UPDATE trigger via a cursor

I have a 3rd party application which uses a cursor that updates rows in my SQL Server 2014 table. I am unable to modify this code and have therefore devised a scheme to point the cursor to a view ...
phehr's user avatar
  • 63
5 votes
2 answers
22k views

MySQL: Loop over cursor results ends ahead of schedule

I'm executing a loop that iterates over a cursor's results. The code is inside a trigger function, and the part that matters looks like that: EDIT: Sorry, stupid mistake. The trigger is executed ...
Jorge Arévalo's user avatar