473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Delay a trigger

Is there anyway to delay a trigger from firing for a few seconds?

I have an after insert trigger on table1, which selects information from
table2 and table3. Obviously it cannot fire unless the required rows in
table2 and 3 are filled out first. I can't just put the trigger on
table2 or 3, because the order of insert there is different, depending
on how the applicaiton is used, plus it would make for a very
complicated trigger goig that way.
Basically in the application, the user picks something, in the database
in either does insert tab1, insert tab2, insert tab3, or if he does
something else, insert tab1, insert tab3 insert tab2.

So the intent is to just delay an after trigger on tab1 from firing for
a few seconds to allow tab2 and 3 to get filled out. I don't think it's
possible,any suggestions? Timing isn't critical for what the trigger
does, it is critical not to hang the application though.

Thanks

Ken
Nov 12 '05 #1
7 3343
>I can't just put the trigger on table2 or 3, because the order of insert there is different

Make two TRIGGERs, one for 2 and another for 3, just check for the
record in the other TABLE in order to do anything.

Nov 12 '05 #2
Not sure how to delay the trigger, but you could dely your trigger
logic after it fired by iterating through a whileloop doing time
calculations compares. Then run your other logic after the loop
finishes. This is an old way of programming time delays

HTH

Chris

Nov 12 '05 #3
Chris wrote:
Not sure how to delay the trigger, but you could dely your trigger
logic after it fired by iterating through a whileloop doing time
calculations compares. Then run your other logic after the loop
finishes. This is an old way of programming time delays

HTH

Chris

The problem with that is it hangs the real insert on tab1 to wait for it
to finish, any time looping for the trigger on tab1, essentially hangs
the insert on tab1, and hence the application waiting for that insert to
finish.
I used 2 triggers like the other person said, with conditional clauses.
The problem I have, is the next trigger I need to make involves
selecting data from 12 tables, not 2, and the order is different
depending on what buttons in the app are being picked. I really don't
want to create 12 triggers with conditional clauses.
Still looking for additional suggestions, thanks for the replies so far!

Ken
Nov 12 '05 #4
I suggest doing this logic in the application language, not using a
trigger.

Nov 12 '05 #5
Larry wrote:
I suggest doing this logic in the application language, not using a
trigger.

No access to it. Closed source.
Nov 12 '05 #6
yoyo wrote:
Larry wrote:
I suggest doing this logic in the application language, not using a
trigger.

No access to it. Closed source.

Use an intermendiate table which is timestamped.
Then do the real work with another connection. Basically you woudl be
using a queue.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #7
If a TRIGGER can CALL another PROCEDURE, have a PROCEDURE do all the
logic. Add a TRIGGER to each of the twelve TABLEs to CALL the PROCEDURE
with it's own name

B.

Nov 12 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Des L. Davis | last post by:
System: Dell PowerEdge Server with 3 GB RAM, 2.4 GHz Celeron Software: Microsoft SQL Server 2000 Enterprise running on Windows 2003 Server Software: Microsoft SQL Server 2000 Enterprise running on...
1
by: M.L. | last post by:
Hi NG, I hope someone in here is able to help me in this matter. The problem: I have created a Javascript drop-down menu which expands when moving the mouse into a tablecell (calls my Expand()...
7
by: JellyON | last post by:
Hi. Is there a way to delay a call to a page counter (ie. call to a server script from an IMG tag) for the purpose to not lock the page loading awaiting counter be displayed. Maybe a...
6
by: lucifer | last post by:
hi i need to insert delay in my program what function should i use the old delay is not supported by the VC6
7
by: mfeingold | last post by:
I am working on a system, which among other things includes a server and a ..net control sitting in an html page and connected to the server. I ran into a couple of problems, you guys might have...
1
by: David Veeneman | last post by:
I want to introduce a one-second delay into the MouseHover event of a label. In other words, I want the user to have to hover over a label for one second before the label's MouseHover event...
37
by: ales | last post by:
Hello, I have a problem with creation of new thread. The method .Start() of newly created thread delays current thread for 0 - 1 second. Cpu while delay occurs is about 5%. Any idea? Here...
3
by: =?Utf-8?B?Um9iZXJ0IFNsYW5leQ==?= | last post by:
I have a state transition trigger by a Delay Activity. If I include the default SQL persistence service, this state transition is fired twice. Any suggestions ?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.