Q

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

Dig deeper on Oracle and SQL

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

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:

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close