Link to home
Start Free TrialLog in
Avatar of aescribens
aescribens

asked on

CFOUTPUT QUERY 1 RECORD AT A TIME

Hello Experts,

I have a query (users) which I need to process one because the process the I have running for each user take about 5 to 10 seconds to process so I need to "step" thru one record at a time, run the process and then move to the next record.  I found that doing simple cfloop or cfoutput does work because it runs too quick and doesn't give suffient time for the process to run per user.

Here is what I'm trying but it doesn't work.

Thanks,

Anthony


<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
<cfparam name="PageNum_billing" default="1">
<cfquery name="billing" datasource="rxnotifydb1">
select *
from users
</cfquery>

<cfset MaxRows_billing=1>
<cfset StartRow_billing=Min((PageNum_billing-1)*MaxRows_billing+1,Max(billing.RecordCount,1))>
<cfset EndRow_billing=Min(StartRow_billing+MaxRows_billing-1,billing.RecordCount)>
<cfset TotalPages_billing=Ceiling(billing.RecordCount/MaxRows_billing)>

<cfoutput query="billing" startRow="#StartRow_billing#" maxRows="#MaxRows_billing#">

#username#

<!--- Process Goes Here, it takes approx 5 to 10 seconds to complete per user --->

<cflocation url="#CurrentPage#?PageNum_billing=#Min(IncrementValue(PageNum_billing),TotalPages_billing)#">

</cfoutput>
Avatar of adonis1976
adonis1976


Is it a CF process that is taking 10 mins? Also why do you a cflocation inside cfoutput??? I don't understand..

If it is a CF process, your cfoutput should work... cfoutput or cfloop go record at a time..
Avatar of aescribens

ASKER

No - It's not a CF Process.  It's a java process which processes an automated payment; what's why it takes so long.

The cflocation in the cfoutput is meant to go to the next record automatically (at least I was hoping it would).  If you href the cflocation URL outside of the cfoutput, you can actually scroll thru all the records manually.  But I was hoping it would do this automatically by putting it inside the cfoutput using cflocation.

Thanks,

Anthony
SOLUTION
Avatar of adonis1976
adonis1976

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial