Home » SQL & PL/SQL » SQL & PL/SQL » scheduling a task
scheduling a task [message #209508] Fri, 15 December 2006 04:37 Go to next message
MarkyMark180
Messages: 2
Registered: December 2006
Location: UK
Junior Member
Hi folks

fairly new to all this SQL stuff, but am very willing to learn...

I need to extract some data from one of our Oracle 8i databases to send to a third party on a daily basis, so am looking to use the received date to select data inserted during today (assuming I schedule a task to run after close of play and before the shutdown for backups.

Therefore I want to complete this statement (with you help hopefully)...

Spool c:\afile.txt
select *
from mytable
where usercode in ('1','2','3','4','5','6','7','8','9','10')
and receiveddate = "TODAY";
SPOOL OFF

Could anybody tell me how to define "TODAY" so that the script takes the system date(?) by default and the script will not need editing everyday?

Thanks folks (I hope this makes sense)

Mark
Re: scheduling a task [message #209513 is a reply to message #209508] Fri, 15 December 2006 05:09 Go to previous messageGo to next message
dhananjay
Messages: 635
Registered: March 2002
Location: Mumbai
Senior Member
hi,


 to_date(receiveddate)=trunc(sysdate).using trunc excludes the time part from the sysdate.



regards,

[Updated on: Fri, 15 December 2006 05:10]

Report message to a moderator

Re: scheduling a task [message #210076 is a reply to message #209513] Tue, 19 December 2006 04:39 Go to previous message
MarkyMark180
Messages: 2
Registered: December 2006
Location: UK
Junior Member
Excellent. Thanks for your help!
Previous Topic: Trigger For insert as well as update
Next Topic: cannot find record
Goto Forum:
  


Current Time: Sat Dec 10 06:47:50 CST 2016

Total time taken to generate the page: 0.08981 seconds