Sub JSON_CreateTableStructure(SQL As SQL, TableName As String, RowMap As Map)
If RowMap.IsInitialized = False Then Return
If RowMap.Size = 0 Then Return
Dim ft As Map:ft.Initialize
Dim field, ftype, fvalue As String
For i = 0 To RowMap.Size - 1
field = RowMap.GetKeyAt(i)
fvalue = RowMap.GetValueAt(i)
If isNumber3(fvalue) = False Then
ftype = DBUtils.DB_TEXT
Else
If fvalue.Contains(".") Then
ftype = DBUtils.DB_REAL
Else
ftype = DBUtils.DB_INTEGER
End If
End If
ft.Put(field, ftype)
Next
DBUtils.CreateTable(SQL, TableName, ft, "rowid", True) 'table in DB
End Sub