Я понял в Xtreme, как написать JSON, который я хотел. Я закончил с этим:
dim jsonOBJ : set jsonOBJ= JSON.parse(join(array(Request.Form("data"))))
{
"prodArray": [{
"idOrder": "266269",
"idProduct": 281953,
"description": "description 1",
"orgweight": 2,
"newweight": 3,
"rootsku": "sku1",
"size": "2T"
}, {
"idOrder": "266269",
"idProduct": 274437,
"description": "description 2 ",
"orgweight": 2,
"newweight": 2,
"rootsku": "sku2",
"size": "3T"
}, {
"idOrder": "266269",
"idProduct": 268546,
"description": "description3 ",
"orgweight": 1,
"newweight": 2,
"rootsku": "sku3",
"size": "3T"
}]
}
И код для обхода массива:
dim key: For Each key in jsonOBJ.prodArray.keys()
set rec=jsonOBJ.prodArray.get(i)
if rec.orgweight <> rec.newweight then
query = "update products set weight=" & rec.newweight & " where rootsku = '" & rec.rootsku & "' and size = '" & rec.size & "'"
connTemp.execute(query)
query="update Product_Weights_master set [" & rec.size & "] = " & rec.newweight & " where sku = '" & rec.rootsku & "'"
connTemp.execute(query)
end if
i=i+1
next