473,545 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3363
>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
18812
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 Windows 2000 Server If you run the code below, you'll notice something odd occuring. The MilliSecond value does not change after a 1Millisecond...
1
2424
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() function at onMouseover on the <td>-element). My question is now this: How do I delay the expansion of the menu for e.g. 500 ms in order to keep...
7
3416
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 setTimeout() launching an equivalent of "document.write", but writing in a specific DIV ? Thanks in advance for your ideas. Actually, the counter is called...
6
5541
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
2933
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 some insight about. 1) It takes 20 sec or so to open a tcp socket from the client to the server. It just sits in the TcpClient.conect waiting for...
1
4641
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 triggers a response from the application. Here's what I've got so far: -- Add a timer control and a bolean DoAction flag to the form. -- Set...
37
8844
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 is code used for measuring:
3
2701
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
7490
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7935
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7780
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6009
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5351
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5069
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3479
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3465
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.