472,325 Members | 1,039 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,325 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 3227
>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...
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...
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...
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...
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...
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...
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. ...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

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.