> Setting up a 'grouped' plan to only run x of them is a valid
> assessment, but I would suggest that you do this by tracking which
> ones need to be redone outside of the page.
> An example would be, you could have each of the necessary redone's to
> show up in a database table, and mark them as completed once they are
> done. The you would just need to pull the oldest 5 of them each time
> you load the page. (this would mean the page would have to be loaded
> more often.
There isn't much to the page with the loop. It's mainly a db call and then I
do the loop based on that, over the page that has the db calls. While I can
see the db page (it has 12 database INSERTs or UPDATEs), I can't alter it, so
no use in posting that.
I thought last night that a way to do sets of five is similar to your
suggestion. I could run the page, having it do just 5 as you suggest. Then I
could have the page reload itself with a cflocation and have it then do the
next 5. That gives time for other processes to be called in between. I could
have the page count up and send the count through the URL and do a certain
number of reloads before it's done for awhile. Then the next time the schedule
comes up, it can go through more of the set. Right now there's a buildup of
records to be worked through. As it cleans up, I would only expect it to have
less than 5 each time it runs.
Here's the loop code:
<CFQUERY name="qry_stuck" datasource="#application.dbDataSource#"
dbtype="#application.dbType#">
SELECT f.g8888_id
FROM g8888 f, case_event ce, spnshp_check sc
WHERE f.g8888_id = ce.g8888_id
AND f.g8888_id = sc.g8888_id
AND f.status_id = 3
AND ce.locked_by_id IS NULL
AND sc.spnshp_chk_type = 'A'
AND sc.on_your_behalf IS NOT NULL
</CFQUERY>
<cfloop query="qry_stuck_in_spnshp" >
<CFQUERY NAME="qryEmpInfo" DATASOURCE="#application.dbDataSource#"
DBTYPE="#application.dbType#">
SELECT g8888.employer_info_id, ei.employer_id, ei.agent_id, g8888.case_no
case_no,
g8888.office_location_id, g8888.Status_ID,
TO_CHAR(g8888.submitted_date,'mm/dd/yyyy') date_received,
ei.address_1 employer_address1, ei.address_2 employer_address2,
ei.Name employer_name,
ei.City employer_city, ei.State_Id employer_state_id, ei.State_Id
employer_state,
s.code employer_state_code, ei.Postal_Code employer_zip,
ei.province employer_province,
ei.country_id employer_country_id,c.name employer_country_name,
substr(ei.postal_code,1,5) employer_postal_code1,
substr(ei.postal_code,7,4) employer_postal_code2, ei.Phone
employer_phone, ei.Phone_Ext employer_phone_ext
FROM g8888, EMPLOYER_INFO ei, state s, country c
WHERE g8888.g8888_id = #g8888_id# AND g8888.Employer_Info_Id =
ei.Employer_Info_Id
and ei.state_id = s.state_id(+) and ei.country_id = c.country_id(+)
</CFQUERY>
<CFLOOP INDEX="x" LIST="#qryEmpInfo.ColumnList#"><CFSET
"#x#"="#evaluate('qryEmpInfo.' & x)#"></CFLOOP>
<cfinclude template="/insert_spnshp_inc.cfm">
</cfloop>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:345823
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm