F FrankDev Active Member Licensed User Longtime User Feb 8, 2018 #1 Hi there is a function like in DBUtil. insertmaps that does exactly the opposite ? This means that the query saves an SQL query in a list. the individual entries of the list are in a map. the single map consists of field name + value regards Frank
Hi there is a function like in DBUtil. insertmaps that does exactly the opposite ? This means that the query saves an SQL query in a list. the individual entries of the list are in a map. the single map consists of field name + value regards Frank
D davidvidasoft Member Licensed User Feb 8, 2018 #2 You are looking for the function called ´DBUtils.ExecuteJSON´. It returns a list inside a map with a key "root". To extract the list you should do something like the following line: Code: Dim list1 As List = DBUtils.ExecuteJSON(SQL, "...", Null, 0, Array As String(...)).Get("root") Upvote 0
You are looking for the function called ´DBUtils.ExecuteJSON´. It returns a list inside a map with a key "root". To extract the list you should do something like the following line: Code: Dim list1 As List = DBUtils.ExecuteJSON(SQL, "...", Null, 0, Array As String(...)).Get("root")
F FrankDev Active Member Licensed User Longtime User Feb 8, 2018 #3 I have the function ExecuteList already found. Only the whole thing doesn't work out like I expected. if I use the Json function, I don't have an additional step because I have to run the result through the Json again to have a plain list. Upvote 0
I have the function ExecuteList already found. Only the whole thing doesn't work out like I expected. if I use the Json function, I don't have an additional step because I have to run the result through the Json again to have a plain list.
OliverA Expert Licensed User Longtime User Feb 8, 2018 #4 FrankDev said: if I use the Json function, I don't have an additional step because I have to run the result through the Json again to have a plain list. Click to expand... Huh? If you are talking about @davidvidasoft's code, it returns a "plain" list of maps. Is this not what you were looking for? The name ExecuteJSON may be confusing you. The method is not returning JSON, but as is documented in the DBUtils code base, the method "executes the given query and creates a Map that you can pass to JSONGenerator and generate JSON text". Upvote 0
FrankDev said: if I use the Json function, I don't have an additional step because I have to run the result through the Json again to have a plain list. Click to expand... Huh? If you are talking about @davidvidasoft's code, it returns a "plain" list of maps. Is this not what you were looking for? The name ExecuteJSON may be confusing you. The method is not returning JSON, but as is documented in the DBUtils code base, the method "executes the given query and creates a Map that you can pass to JSONGenerator and generate JSON text".
D davidvidasoft Member Licensed User Feb 8, 2018 #5 And it returns exactly what you asked in the original question. Maybe if you can put a sample code we can help you in a better way. Upvote 0
And it returns exactly what you asked in the original question. Maybe if you can put a sample code we can help you in a better way.
F FrankDev Active Member Licensed User Longtime User Feb 9, 2018 #6 Hi you're right, it's actually exactly the function I need. The name of the function' ExecuteJSON' really confused me. Then the list is packed into a map and returned. Do you really need the type list (Text, Integer, Real)? I've always wrapped all Types in a string. The entry in the list is almost always a string. Real and Intger are converted correctly. I have now tried this with about 3000 records. The result was always correct. Upvote 0
Hi you're right, it's actually exactly the function I need. The name of the function' ExecuteJSON' really confused me. Then the list is packed into a map and returned. Do you really need the type list (Text, Integer, Real)? I've always wrapped all Types in a string. The entry in the list is almost always a string. Real and Intger are converted correctly. I have now tried this with about 3000 records. The result was always correct.