Problem solve Get help with specific problems with your technologies, process and projects.

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?

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 last published in October 2002

Dig Deeper on Oracle and SQL

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

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

Please create a username to comment.