Question
missing the piece of code where i am unable to generate the results in pagination and writing file
I have this code for CF where i am trying to fetch the rows of the tables by minimizing the load on server
<cfset var offset = 0>
<cfset listoverloop = "users,roles,adresses,email">
<cfloop list="#loopoverLst#" index="k">
<cfquery name="local.sTotalRecords" attributeCollection="#variables.dataAttr#">
select count(1) as totalRecords
from #table#
</cfquery>
<cfset local.offsetrequired = local.sTotalRecords.totalRecords gte 1000 ? 'yes' : 'no'>
<cfset local.rowsTofetch = "1500">
<cfquery name="insertData" attributeCollection="#variables.dataAttr#">
SELECT
* FROM #k#
ORDER BY 1 DESC
OFFSET #local.offset# ROWS
FETCH NEXT #local.rowsTofetch# ROWS ONLY
<cfsavecontent variable="createTt">
<cfloop query="insertData">
write my inserts
<cfset local.offset += local.rowsTofetch>
</cfloop>
</cfsavecontent>
<cfif FileExists("#ExpandPath('#table#.sql')#")>
<cffile action="append" file="#ExpandPath('#table#.sql')#" output="#createTt#">
<cfelse>
<cffile action="write" file="#ExpandPath('#table#.sql')#" output="#createTt#">
</cfif>
but it is not doing any pagination for the records, because i am writing the records in the files
