You are not logged in.
The json file I got is a very big one with lot of levels and would normally be split up into several tables but I have been asked to make one flat table of it.
To me it looks as very complicated task to solve so I would be happy to get some help to put me in the right direction.
I suppose that there are some very useful code in mormot. I've been looking a round a bit but it isn't that easy.
Delphi-11, WIN10
Offline
It has a fixed fields layout. I think it is created from a XML-file.
Just below 1MB > 24000 lines.
9 levels.
Last edited by larand54 (2024-06-19 15:46:35)
Delphi-11, WIN10
Offline
I would try to define the structure as records and dynamic arrays, and let mORMot load it directly into memory.
Then write it into the database.
If the main format is a JSON array of JSON objects (which are complex), each JSON object needing to be written in the database, then I would read and process one object at a time.
Online
I'm not sure I understand the last sentence. I can show you the last part of the jsonfile if that helps.
"DetaljReferens": [
{
"Referens": null,
"Referens_ReferensLista": "BSAB96:PR",
"Referens_ReferensKod": ""
},
{
"Referens": null,
"Referens_ReferensLista": "SBEF:Byggdel",
"Referens_ReferensKod": "90"
},
{
"Referens": null,
"Referens_ReferensLista": "PRODKOD",
"Referens_ReferensKod": ""
}
]
}
}
]
}
}
}
Delphi-11, WIN10
Offline
So it is not an array of objects, but an object with nested content.
I don't know how to make it "flat", since it is not an array as root.
1MB is not big, so I would go into filling some records and array of records with the value, then use it as high-level data structures to fill your DB with some meaningful content.
Online
I'll go for that, thanks ab.
Delphi-11, WIN10
Offline