• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Triggering and Stopping a Stored Procedure

Guest
Jun 12, 2007 Jun 12, 2007

Copy link to clipboard

Copied

I'm setting up a mass mailing system for approx 250,000 users.

I need to find a way to trigger a stored procedure to run every 5 miuntes untill the task is complete. The idea being that once triggered it'll work its merry way through the database firing off a couple of thousand emails each cycle untill it's reached the end.

Any ideas how to implement this?

Thanks
TOPICS
Advanced techniques

Views

260

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 12, 2007 Jun 12, 2007

Copy link to clipboard

Copied

Generally, the term "stored procedure" is used to mean a piece of SQL code that is stored and run in the database server. It sounds like what you mean is a ColdFusion Scheduled Task - a piece of CF code that is run automatically. You can set these up using either the CF administrator or the <cfschedule> tag. Breaking up your mailings is a good idea since CF will probably time out if you try to execute 250,000 mailings at once. You could do something like this:

1) If unsent records, do:
2) Select X number of unsent records
3) Send mail
4) Update X records as having been sent

You would just have to make sure that you time it correctly, otherwise you could wind up with 1 process starting before the other finishes and some people will get duplicate emails.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 13, 2007 Jun 13, 2007

Copy link to clipboard

Copied

The email content is provided using a form in the sites CMS - at the moment I have the submit button going to a page that runs the cycle, sends the email to 2,000 users, marks it as sent in the database and then waits 5 minutes before reloading that page and starting from the next record.

How do I implement that with cfshedule? I've never needed to use it before so I'm totally in the dark.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 13, 2007 Jun 13, 2007

Copy link to clipboard

Copied

LATEST
Take a look at the Adobe docs on cfschedule. I believe there is an example there that might shed some light:

http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-a30.htm

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation