Skip to main content

Compare-Datatables

Command Description

Compare the content of two datatables to see if there are differences (compare data only)

Command Prototype

bRet = Datatable.CompareDataTable(dtSrcTable,dtDistTable)

Parameter Description

ParameterRequiredTypeDefaultDescription
dtSrcTableTrueexpressiondtSrcTableCompare the content of the two data sheets; one is called source data table; the other is called target data table
dtDistTableTrueexpressiondtDistTableCompare the content of the two data sheets; one is called source data table; the other is called target data table

return

bRet,The variable used to save the output of the command.

Demo

aryData = [["a", 1], ["b", 2], ["c", 3], ["d", 1]] 
aryColumns = ["letter", "number"]
objDatatable = Datatable.BuildDataTable(aryData,aryColumns)

aryData2 = [["a", 1], ["b", 2]]
aryColumns2 = ["letter", "number"]
objDatatable2 = Datatable.BuildDataTable(aryData2,aryColumns2)

bRet = Datatable.CompareDataTable(objDatatable,objDatatable2)
TracePrint(bRet)
// false