Automatically update or delete records (records) after x time in coldfusion

I searched the net for this. Hope someone got something.

How will the database record automatically update after x time n coldfusion?

I know how to do this manually by writing sql, which performs an action on all records older than x based on timestamp.

How to do it automatically?

Regards, Nich

+4
source share
3 answers

Record a request for a new ColdFusion template, then use CFSCHEDULE to schedule a task to run this template at the appropriate time.

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

+5
source

You can create a scheduled task in ColdFusion Administrator (CFIDE) that runs a cfm script. Inside your cfm script, just write a request to update the data depending on the age of the recording.

+5
source

Depending on your goal, there may be other means to accomplish what you want to do.

If you are using MS-SQL 2k5 +, you can use a computed column. For example: "(CASE WHEN GetDate () <= DateAdd (hh, 1, DateCreated) THEN" I'm expired "ELSE" I'm still waiting for "END)"

Or you can create a view to perform similar transformations in the data.

This may not work on what you want to accomplish, but I decided that I would publish it anyway.

0
source

Source: https://habr.com/ru/post/1308242/


All Articles