这是 JSON 的样子:
{
"event_id": 1,
"des": "State ID:*",
"des1": "job failure",
"event_type": "now",
"parm_ds": {
"sup": {},
"steps": {
"9": {},
"10": {},
"2": {}
},
"event_parms": {}
},
"event_id": 2,
"des": "State ID:2*",
"des1": "job failure1",
"event_type": "now2",
"parm_ds": {
"sup": {},
"steps": {
"9": {},
"10": {},
"2": {}
},
"event_parms": {}
} }
我想将这些详细信息插入回数据库,因此我想获取每个 json 对象并从每个对象中提取详细信息,然后将其输入回数据库,其中包含 event_id、des、des1、event_type 和 parm_ds 列。请建议我如何做到这一点。
在这种情况下:
{
"event_id": 1,
"des": "State ID:*",
"des1": "job failure",
"event_type": "now",
"parm_ds": {
"sup": {},
"steps": {
"9": {},
"10": {},
"2": {}
},
"event_parms": {}
}
是单个 JSON 对象