schedule coldfusion page

hai all i have a transfer_Data.cfm as follows
if any body can help to schedule every day morning 6am

<cfquery name="shrimpydata" datasource="Shrimpy">


SELECT SD.BILLID,SD.ITEMID,SD.ITEMQTY,SD.RATE,SD.BILLDATE,SD.LOCATIONID,SD.TRANTYPE,SM.SUCCESS,SM.CHEFID
FROM SALESMASTER SM INNER JOIN SALESDETAILS SD ON SM.BILLID=SD.BILLID AND SM.BILLDATE=SD.BILLDATE AND
SM.LOCATIONID=SD.LOCATIONID AND SM.TRANTYPE=SD.TRANTYPE
WHERE SM.SUCCESS='Y' AND SD.BILLDATE=CONVERT(VARCHAR,GETDATE()-1,107) AND SM.chefid<>1



</cfquery>



<cfloop query="shrimpydata">
<cfquery name="track" datasource="track">

<cfset new_Date=#createodbcdatetime(#BILLDATE#)#>

INSERT INTO SHRIMPY_SALES(BILLID,
ITEM_ID,
QTY,
LOCATION_ID,
TRAN_TYPE,
RATE,
BILLDATE)
VALUES(#shrimpydata.BILLID#,
#shrimpydata.ITEMID#,
#shrimpydata.ITEMQTY#,
#shrimpydata.LOCATIONID#,
#shrimpydata.TRANTYPE#,
#shrimpydata.RATE#,
#new_Date#)

</cfquery>

</cfloop>


<cfquery name="ShrimpyUpdate" datasource="Shrimpy">

UPDATE SALESMASTER SET CHEFID=1 WHERE BILLDATE=CONVERT(VARCHAR,GETDATE()-1,107)


</cfquery>

thanks
faizershezAsked:
Who is Participating?
 
SidFishesConnect With a Mentor Commented:
the easiest way is to use Add/Edit Scheduled Task in CFadmin...just point the task at the url of the page you want to run.

You can also use cfschedule...check the docs for usage
0
 
sajaycConnect With a Mentor Commented:
Hi,
Create a coldfusion page with the following code and run it.
This will create the schedule to run every day at 6am.
You need to customise the task name and siteurl.

<cfschedule action="update"
            task="transferdata"
            operation="HTTPRequest"
            url="http://siteurl/transfer_Data.cfm "
            startdate="31 July 2007"
            starttime="06:00"
            interval="Daily"
            requesttimeout="100"
            resolveurl="no"
            publish="no">

Hope this helps.
0
All Courses

From novice to tech pro — start learning today.