user1575044
user1575044

Reputation: 101

Delay in Trigger Update

I want to create an Update trigger which updates the values of column say status1 in database after column say status2 has been updated of the same table ?

But this(the updating) should happen after a delay of 3 minutes.

Please provide sample code

Upvotes: 1

Views: 1187

Answers (1)

eaolson
eaolson

Reputation: 15092

Here's what I would do:

  1. Create a PL/SQL procedure that scans your table for orders that have been placed but not paid for after 3 minutes. I assume you have timestamps or something in the table so you can tell when the order was placed.

  2. Create a DBMS_SCHEDULER job that calls your procedure. Have the job run every 3 (or 2, or 1) minutes.

  3. Now, all you have to do is insert into your table normally.

Upvotes: 1

Related Questions