Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically update or delete record(s) after x time in coldfusion

I've searched all over the net for this. Hope that someone's got something.

How would a record in a database be updated automatically after x time n coldfusion?

I know how to manually do it by writing an sql that performs an action to all records older than x time based on the timestamp.

How would this be done automatically?

Kind Regards, Nich

like image 673
Nich Avatar asked Dec 29 '22 18:12

Nich


2 Answers

Write out the query to a new ColdFusion template, then use CFSCHEDULE to schedule a task to run that template at the appropriate time.

CFSCHEDULE docs: http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_r-s_11.html

like image 160
Edward M Smith Avatar answered Dec 31 '22 06:12

Edward M Smith


You can created a scheduled task in the ColdFusion Administrator (CFIDE) that runs a cfm script. Inside your cfm script simply write a query to update the data based on the age of the record.

like image 35
John Whish Avatar answered Dec 31 '22 06:12

John Whish