Link to home
Start Free TrialLog in
Avatar of venkatesh Sarivisetty
venkatesh SarivisettyFlag for India

asked on

I need to run a Java script which will run every on scheduled time

Hi,

I have a requirement in Java script to run the select statements every 3 hours and update those select count(*) counts in a spreadsheet. Kindly share the code snippet to accomplish this request.

Also we are running

1. 2 scripts 3 hours once in a day.
2. 1 Script once in a day.
3. 1 script on particular times like 10.45, 11.15....

please let me know if you need any more details.

Thanks
Venkatesh.
Avatar of HainKurt
HainKurt
Flag of Canada image

use oracle jobs...

just create a package called jobs
and inside this package add your procedures
like job1 job2 etc...
then in oracle, create jobs and call jobs.job1 jobs.job2, set start time and intervals...

thats it
if this is a windows machine and db jobs is not possible, then

create

job1.bat, job2.bat,...

which calls job1.sql, job2.sql,...

which calls sqlplus to connect and run queries or stored procs in oracle...

then use windows scheduler and create tasks that calls these batch files on regular intervals...
now to update spreadsheets, I am assuming it is excel file, you need some vba code, or write a custom application that accepts

- filename
- sheetname or sheetnumber
- row, col of excel
- value to be updated...

then call this executable from bat file
Avatar of CEHJ
IOW, Javascript is not the tool for the job. What is your OS?
Avatar of venkatesh Sarivisetty

ASKER

windows
then use windows scheduler and create tasks that calls these batch files on regular intervals...
You could make them Powershell scripts these days maybe
sample code pls..
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial