Photops
Photops

Reputation: 322

How to run code from sql file directly from toad oracle

i have a *.sql file on my desktop. How can i create a job in toad for oracle so that it can directly pick up the file and run it everyday at a specific time. thank you

Upvotes: 0

Views: 20373

Answers (2)

Ashish Shetkar
Ashish Shetkar

Reputation: 1467

well different version of the TOAD have different options the best way i would suggest you is - on the button "Execute as script"

Execute as script --> Execute via SQL plus 

then the SQL-plus window will pop up and it will auto connect to your DB. Gather all your sql queries / script in the file and run below command

@C:\Users\Desktop\script.sql

this will start executing the script from file directly and will give the log in the SQL plus window.

Upvotes: 0

Michael S.
Michael S.

Reputation: 1791

What version of Toad? If it's a somewhat newer one, check out the Automation Designer. It's available from the Utilities menu.

  1. Create a new app on the left side, give it a meaningful name
  2. On the DB Misc tab double click the Execute Script action to add it to your app.
  3. Double click the new execute script action and add your file to it. Set other options within as desired.
  4. Click Apply and exit the script action properties dialog.
  5. Right click on your script action and choose Schedule. Work through the Windows Task Scheduler prompts and it will be setup for you.

Upvotes: 1

Related Questions