Sepehr_b
Member
Hi,
It seems that ExecuteJSON converts Null value in Integer fields to 0
see the following code:
here is pasted from the log:
ExecuteMap: SELECT FDId,Qty FROM FactorDetails WHERE FdId = 659947
(MyMap) {fdid=659947, qty=null}
ExecuteJSON: SELECT FDId,Qty FROM FactorDetails WHERE FdId = 659947
[{FDId=659947, Qty=0}]
it should make equal maps but in the second map, the value of Qty is 0, it should be Null
It seems that ExecuteJSON converts Null value in Integer fields to 0
see the following code:
B4X:
Dim mT1 As Map = DBUtils.Executemap(B4XPages.MainPage.Db, $"SELECT FDId,Qty FROM FactorDetails WHERE FdId = 659947"$, Null)
Log(mT1.As(String))
Dim mT2 As Map = DBUtils.ExecuteJSON(B4XPages.MainPage.Db, $"SELECT FDId,Qty FROM FactorDetails WHERE FdId = 659947"$, Null, 0, Array As String(DBUtils.DB_INTEGER, DBUtils.DB_INTEGER))
Log(mT2.Get("root").As(String))
here is pasted from the log:
ExecuteMap: SELECT FDId,Qty FROM FactorDetails WHERE FdId = 659947
(MyMap) {fdid=659947, qty=null}
ExecuteJSON: SELECT FDId,Qty FROM FactorDetails WHERE FdId = 659947
[{FDId=659947, Qty=0}]
it should make equal maps but in the second map, the value of Qty is 0, it should be Null