Wish DButils ExecuteMaps

Sepehr_b

Member
Hi Erel,
the DBUtils.InsertMaps is a very usefull function and I was searching for the vice function to read from table to list of Maps, although there is a ExecuteToMemory which makes an array, but it can be a good idea to have a function to make a list of maps from database.

I made one for myself, but I prefer to use in internal functions in newer versions

My ExecuteMaps:
Public Sub ExecuteMaps(Sql As SQL,Query As String,StringArgs() As String,Limit As Int, PK As String) As List
    Dim lstFinal As List
    lstFinal.Initialize()
    Dim tmpList As List = DBUtils.ExecuteList(Sql,Query,StringArgs,Limit)
    For Each r In tmpList
        Dim m As Map = DBUtils.Executemap(Sql,$"SELECT * FROM (${Query}) as _tmp WHERE ${PK} = ${r}"$,StringArgs)
        lstFinal.Add(m)
    Next
    Return lstFinal   
End Sub
 

Spavlyuk

Active Member
Licensed User
Longtime User
ExecuteJSON should do what you need, just extract the list from the "root" key.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…