I am using the following code, the code works but the issue is for 20000 records, the loop is taking too much time and timing out.
so basically it is like this
<cfset x = new myapi()>
<cfparam name='length' default="0">
<cfparam name='start' default="5000">
<cfset iQEmpty = false>
<cfloop condition="true">
<cfquery name="rs">
select * from mytable limit #start#,#length#
</cfquery>
<cfset start += rs.recordCount>
<cfset myst = queryToJson(rs)>
<cfset call = x.UpsertData(myst)>
<cfif rs.recordCount NEQ 1000>
<cfbreak>
</cfif>
</cfloop>
Can't use coldfusion latest because i am still stuck on cf11 and upsert is expecting a json data to be sent
If you don't care about how long your script runs but just want to avoid the timeout, you can increase the time limit via
<cfsetting>. E.g. you can set the timeout to 10 minutes by writing this: