I have a JSON object, name it jObject, which looks like this:
{ "id": 0, "data": "[{DAT_INCL: \"08/03/2012 10:07:08\", NUM_ORDE: 1, NUM_ATND: 1, NUM_ACAO: 2, NUM_RESU: 3}, {DAT_INCL: \"08/03/2012 10:07:09\", NUM_ORDE: 2, NUM_ATND: 1, NUM_ACAO: 4, NUM_RESU: 5}, {DAT_INCL: \"08/03/2012 10:07:09\", NUM_ORDE: 3, NUM_ATND: 1, NUM_ACAO: 8, NUM_RESU: NULL}]" }
As you can see, it contains two pairs, one of which is an array with three objects in this case (the number of objects is dynamic) with several "keys: values" (they do not change, they are always the same 5 fields) that I want insert into the SQL database, "key" is a column, "value" is a field. The question is, how can I access each object individually?
In the code that I did, the pair containing this array was extracted, putting it in jPair
jPair := OriginalObject.Get(1);
and then captured an array
jArray:= TJSONArray(jPair.JsonValue);
(Also, as a bonus, when I evaluate jArray.Size, the result is 6226004. What?)
json sql delphi datasnap
bpromas
source share