Home » Other » Client Tools » Scheduling an query to run at a particular time (SQL)
Scheduling an query to run at a particular time [message #338976] Wed, 06 August 2008 06:27 Go to next message
abhishekjana
Messages: 5
Registered: August 2008
Location: Kolkata
Junior Member
I have a query that i need to run every day at a particular period of time. how can I schedule that query to run automatically at a particular time everyday.
I need it very urgently.
Re: Scheduling an query to run at a particular time [message #338977 is a reply to message #338976] Wed, 06 August 2008 06:32 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
DBMS_JOB/DBMS_SCHEDULER
Re: Scheduling an query to run at a particular time [message #338978 is a reply to message #338976] Wed, 06 August 2008 06:44 Go to previous messageGo to next message
abhishekjana
Messages: 5
Registered: August 2008
Location: Kolkata
Junior Member
But i want schedule this for TOAD
Please give me an example, i shall be very thankful
Re: Scheduling an query to run at a particular time [message #338980 is a reply to message #338978] Wed, 06 August 2008 06:49 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Toad doesn't come with a scheduler, so you're probably out of luck.

If you were feeling masochistic, you could create a Windows scheduled task to fire up TOAD, and play about with the command line options to get it to execute a file containing your query.

Why don't you back up a step, and tel us what the problem you're trying to solve is. That way you're more likely to get a useful answer than by asking for a way to implement a specific solution.
Scheduling an query to run at a particular time [message #339063 is a reply to message #338976] Wed, 06 August 2008 12:28 Go to previous messageGo to next message
abhishekjana
Messages: 5
Registered: August 2008
Location: Kolkata
Junior Member
OK, am elaborating about my problem. I have a query (actually a cursor) that i need to run before 10am everyday. i want a method that will automtically trigger the cursor to run before that time(or the time i set for the cursor to run). this will help me to automate the process. Moreover i need to run the cursor in TOAD.
how can i configure the particular cursor to run everyday at a certain time?

please give me suggestions and examples to solve the problem. I need it urgently.
Re: Scheduling an query to run at a particular time [message #339070 is a reply to message #339063] Wed, 06 August 2008 12:40 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Why do you NEED to run the query in TOAD.
What can TOAD do what other programs cannot do?
Re: Scheduling an query to run at a particular time [message #339075 is a reply to message #338976] Wed, 06 August 2008 12:49 Go to previous messageGo to next message
Kaeluan
Messages: 179
Registered: May 2005
Location: Montreal, Quebec
Senior Member
Why not creating a procedure that can be schedule in dbms_job and this procedure can run the cursor and insert the result in some table to allow you or someone else to monitor the result when you want.

I agree with Frank, there is no reason to force this qury to run in toad.
Re: Scheduling an query to run at a particular time [message #339087 is a reply to message #338976] Wed, 06 August 2008 13:32 Go to previous messageGo to next message
abhishekjana
Messages: 5
Registered: August 2008
Location: Kolkata
Junior Member
As I am working as a software professional we have to use TOAD as it is our project requirement.
please suggest, moreover can you give some example about how to write a procedure that will trigger the cursor as required
Re: Scheduling an query to run at a particular time [message #339089 is a reply to message #338976] Wed, 06 August 2008 13:39 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
TOAD is the wrong tool for this task.
It is the equivalent to using a hammer to divide a board into 2 pieces. You might succeed but you'll expend more energy than necessary to accomplish the task.

You're On Your Own (YOYO)!
Re: Scheduling an query to run at a particular time [message #339106 is a reply to message #339087] Wed, 06 August 2008 14:50 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
abhishekjana wrote on Wed, 06 August 2008 20:32
As I am working as a software professional we have to use TOAD as it is our project requirement.
please suggest, moreover can you give some example about how to write a procedure that will trigger the cursor as required

Do you run your batches in TOAD? No, you use TOAD to develop your batches.
You do NOT use TOAD for production run-time thingies.
Re: Scheduling an query to run at a particular time [message #339796 is a reply to message #339063] Fri, 08 August 2008 09:13 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
What happens to the outout from this cursor?
Is it just dsplayed visually on a screen, ot is it stored in a table?
Re: Scheduling an query to run at a particular time [message #339947 is a reply to message #339087] Sun, 10 August 2008 02:52 Go to previous messageGo to next message
William Robertson
Messages: 1643
Registered: August 2003
Location: London, UK
Senior Member
abhishekjana wrote on Wed, 06 August 2008 19:32
As I am working as a software professional we have to use TOAD as it is our project requirement.

TOAD is an editor for developers! What do you want to happen, TOAD to pop up automatically on your desktop and run a report? Is this to create an output file in a special format maybe? I don't know whether TOAD can be called in batch mode like this (although PL/SQL Developer can) but as JR mentioned, you would still need to schedule it somehow from Windows.

btw a cursor cannot be "run" or "triggered", it is part of SQL's query mechanism.
Re: Scheduling an query to run at a particular time [message #339952 is a reply to message #339087] Sun, 10 August 2008 05:36 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
Quote:
As I am working as a software professional we have to use TOAD as it is our project requirement.

How come you didn't mention it is one of the clients requirement where they explicitly mention we need to use TOAD and run the query only in TOAD and not to use any other tool for this output.

O.K if you really really want to do it in TOAD the one of the option I can think of is using test tools like Winrunner/QA-Run and I believe it can be scheduled to run a script at a specified time. But still I strongly believe this is not the right way to do it.

Regards

raj

Re: Scheduling an query to run at a particular time [message #422364 is a reply to message #339952] Tue, 15 September 2009 17:01 Go to previous messageGo to next message
jrichmo
Messages: 4
Registered: September 2009
Location: AZ
Junior Member
Hi all. I am attempting something similar and think I kind of understand some of the suggestions. I am trying to schedule a query to run to update a table with the results of a select query nightly as well. My knowledge extent so far is just writing queries in TOAD to extract data, never anything like scheduling anything.

If I understand some of the answers this needs to be done not by having toad magically open and run a query but as some sort of stored procedure. I am all for learning and not asking for specific solutions so if someone would be so kind to explain how I would go about doing this and possibly give an easy example I would be be most grateful!

Thanks,

Jason R
Re: Scheduling an query to run at a particular time [message #422370 is a reply to message #422364] Tue, 15 September 2009 22:56 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Have a look at DBMS_JOB.

Regards
Michel

[Edit: typo]

[Updated on: Thu, 17 September 2009 01:11]

Report message to a moderator

Re: Scheduling an query to run at a particular time [message #422500 is a reply to message #422370] Wed, 16 September 2009 22:11 Go to previous message
jrichmo
Messages: 4
Registered: September 2009
Location: AZ
Junior Member
Thanks Michel, I'll take a look and try to learn something newtoday!

Jason

[Updated on: Wed, 16 September 2009 23:59]

Report message to a moderator

Previous Topic: session times out every 10 minutes
Next Topic: oracle 9i and Oracle Developer suit Installation problem
Goto Forum:
  


Current Time: Fri Mar 29 03:14:46 CDT 2024