Ask the Expert

Scheduling a query

I want to fire a query on the table on one particular time, say Sunday 12:00 P.M. Does an SQL table trigger execute this kind of stored query?

    Requires Free Membership to View

You may schedule a procedure to run at any time using the DBMS_JOB supplied package. Simply write a procedure to do what you want and then schedule it to run using the DBMS_JOB.SUBMIT procedure. Besides reading up on the DBMS_JOB package in the Oracle Supplied Packages Reference, there's a great article at: http://www.pinnaclepublishing.com/OP/OPmag.nsf/0/C31F87A073306A72852568F00065982B.

If, however, you are wanting to simply run a query (just a SELECT statement) to spool out a report to a file, then you can use your operating system's scheduling mechanisms (for instance, cron) to cause it to start a SQL*Plus session and run a script (.sql) that contains your query. A good cron overview can be found at: http://www.unixgeeks.org/security/newbie/unix/cron-1.html.

For More Information


This was first published in October 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: