deleteOldTableData(ctx, tablename, version, batchsize, progresscallback, progressrowcount)
Deletes old versions of imported data from a table.
Parameters
Name | Type | Description |
---|---|---|
ctx | Struct, required | Database details, see above |
tablename | String, required | The name of the table to delete data from |
version | Integer, required | The earliest version of the data to keep. Versions earlier than this will be deleted |
batchsize | Integer, optional | The number of rows to delete in each query. Defaults to 10000 |
progresscallback | Function, optional | A callback function which is told how many rows have been processed. The function must not return a value. It takes one augments: nDeleted (Integer) the number of rows that have been deleted |
progressrowcount | Integer, optional | The number of rows after which the progresscallback function is called. Defaults to 100000 |
Returns
Boolean. True when the data is deleted.
Example
<cfset ds=APPLICATION.datasource>
<cfset dt=APPLICATION.databasetype>
<cfset tablename="timstable">
<!--- get a data importer --->
<cfmodule template="/icm/admin/dataimport/importer_v1.cfm" name="di" datasource=#ds# databasetype=#dt#>
<!--- delete a solr collection --->
<cfset di.deleteOldTableData(ctx=#di#,
tablename=#tablename#,
version=2
)>
<cfoutput>...Done<br></cfoutput><cfflush>
Last modified on 30 September 2022