mousemat24
asked on
How to right a schuduled trigger that runs a stored procedure (in a package)
Hi
Wonder if you can help me?
Im new to oracle, so please bear with me. I need to create a trigger to run at 02:00am and it should run a stored procedure (which is located in a package)
Can someone please give me the code to do this?
Thanks
Mousemat24
Wonder if you can help me?
Im new to oracle, so please bear with me. I need to create a trigger to run at 02:00am and it should run a stored procedure (which is located in a package)
Can someone please give me the code to do this?
Thanks
Mousemat24
Mike is correct, you need to use DBMS_JOB. I'm not sure when the new DBMS_SCHEDULER appeared but I think it wasn't until 10g.
I suggest you take a look at the docs:
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_job.htm#999107
I suggest you take a look at the docs:
http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_job.htm#999107
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You cannot "run" a trigger, a trigger is a special procedure that executes each time the corresponding DML statement (INSERT/UPDATE/DELETE) is applied to the table. (Read about triggers in the manual).
You can write a procedure and schedule it to execute at any time using either the DBMS_JOBS package or the DBMS_SCHEDULER package.