Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql submitted on timer

Status
Not open for further replies.

bookor

MIS
Apr 21, 1999
33
US
I need to run a SQL script unattended on a time/date basis.<br>
For example, I need a select script to run every hour to extract a set of records into a delimited text file. What is the best way to accomplish this? Im working with Oracle Pl/Sql but have VB available if necessary. However, I want to use the most efficient method possible because the script will be running against a fairly large database.<br>
<br>
Any advice, assistance in creating a text file with sql and running it unattended would be appreciated<br>
<br>
bob<br>

 
If your database is on a UNIX system you can use cron to<br>
schedule a sql script to start your PL/SQL.
 
It is on NT. There is an "at" command in nt. which i'm sure is similar. Theoretically I could schedule it to run sql/plus on a periodic basis but ive never had any luck getting it to work correctly. <br>
<br>
thanks for the reply<br>
<br>
<br>

 
You could use the dbms_job package inside Oracle<br>
to schedule the running of a stored procedure. The<br>
stored procedure in turn could perform the select<br>
into a cursor object, open up a file for writing,<br>
then loop through the cursor and write out to your<br>
file.<br>
<br>

 
I found some references to dbms_job, but even in my best ref books there is no description of how to use it. It is mentioned by name but there are NO examples of how to use it. Is there any chance you could point me to any examples of using dbms_job? <br>
<br>
IT would be a great help if I could find some details on it.<br>
<br>
thanks for the reply<br>
<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top