Kinda confused...
A funny thing here, some records in my database table return the field names properly and the column values and some just return NullPointerException at the Log(GetType(fValue)) line. If I comment out the
, it also just crashes on that line. An intergrity check
PRAGMA integrity_check
returns ok. What could I be doing wrong?
I want the map that is returned not to have null values as those need to be just blank.
B4X:
Public Sub ExecuteMap(jSQL As SQL, Query As String, StringArgs() As String) As Map
Dim res As Map
Dim cur As ResultSet
If StringArgs <> Null Then
cur = jSQL.ExecQuery2(Query, StringArgs)
Else
cur = jSQL.ExecQuery(Query)
End If
If cur.NextRow = False Then
'Log("No records found.")
Return res
End If
res.Initialize
For i = 0 To cur.ColumnCount - 1
Dim fName As String = cur.GetColumnName(i)
Dim fValue As String = cur.GetString2(i)
Log(GetType(fValue))
Log(fName)
Log(fValue)
'If fValue = "null" Then fValue = ""
res.Put(cur.GetColumnName(i).ToLowerCase, fValue)
Next
cur.Close
Return res
End Sub
A funny thing here, some records in my database table return the field names properly and the column values and some just return NullPointerException at the Log(GetType(fValue)) line. If I comment out the
B4X:
If fValue = "null" then fValue = ""
PRAGMA integrity_check
returns ok. What could I be doing wrong?
I want the map that is returned not to have null values as those need to be just blank.