10-11-2019, 07:50 PM
Here is some sample code on how to use cdb_batchSync
//THIS API WILL SYNC MULITPLE TABLES AT ONCE
//pInputA: This array contains primary keys of tableID. The secondary keys are
//(cdbRecordID,source,allowDeletes,detectCollisions)
—REPEAT THROUGH ALL TABLES AND BUILD AND INPUT ARRAY
—THIS EXAMPLE WILL DO FULL TABLE SYNCS
—YOU COULD SWITCH OUT THE ‘*’ FOR LINE DELIM RECORD IDS IF YOU WANT TO DO PARTIAL SYNCS
repeat for each line xTableID in cdb_tableID("*")
put "*" into tInputA[xTableID]["cdbRecordID"]
put “cloud" into tInputA[xTableID]["source"]
put true into tInputA[xTableID]["allowDeletes"]
put true into tInputA[xTableID]["detectCollisions"]
end repeat
put cdb_batchSync(tInputA) into tResults
if not cdb_result() then
put "Error:" && cdb_result("response")
end if
//THIS API WILL SYNC MULITPLE TABLES AT ONCE
//pInputA: This array contains primary keys of tableID. The secondary keys are
//(cdbRecordID,source,allowDeletes,detectCollisions)
—REPEAT THROUGH ALL TABLES AND BUILD AND INPUT ARRAY
—THIS EXAMPLE WILL DO FULL TABLE SYNCS
—YOU COULD SWITCH OUT THE ‘*’ FOR LINE DELIM RECORD IDS IF YOU WANT TO DO PARTIAL SYNCS
repeat for each line xTableID in cdb_tableID("*")
put "*" into tInputA[xTableID]["cdbRecordID"]
put “cloud" into tInputA[xTableID]["source"]
put true into tInputA[xTableID]["allowDeletes"]
put true into tInputA[xTableID]["detectCollisions"]
end repeat
put cdb_batchSync(tInputA) into tResults
if not cdb_result() then
put "Error:" && cdb_result("response")
end if