Android Question Dbutils var sql warning (solved)

ocalle

Active Member
Licensed User
Longtime User
Hello, I testing Dbutils module, when i add have this error, how can i fix it. Im Using B4a 7.80 and SDK 27
 

Attachments

  • added.png
    added.png
    89 KB · Views: 233

ocalle

Active Member
Licensed User
Longtime User
Apologize isnt an error, is a warning about the SQL Variable cannot defined as SQL


then name of var "sql" is the name of a module



B4X:
Public Sub CreateTable(sql As SQL, TableName As String, FieldsAndTypes As Map, PrimaryKey As String)
    Dim sb As StringBuilder
    sb.Initialize
    sb.Append("(")
    For i = 0 To FieldsAndTypes.Size - 1
        Dim field, ftype As String
        field = FieldsAndTypes.GetKeyAt(i)
        ftype = FieldsAndTypes.GetValueAt(i)
        If i > 0 Then sb.Append(", ")
        sb.Append("[").Append(field).Append("] ").Append(ftype)
        If field = PrimaryKey Then sb.Append(" PRIMARY KEY")
    Next
    sb.Append(")")
    Dim query As String
    query = "CREATE TABLE IF NOT EXISTS [" & TableName & "] " & sb.ToString
    Log("CreateTable: " & query)
    sql.ExecNonQuery(query)
End Sub

'Deletes the given table.
Public Sub DropTable(sql As SQL, TableName As String)
    Dim query As String
    query = "DROP TABLE IF EXISTS [" & TableName & "]"
    Log("DropTable: " & query)
    sql.ExecNonQuery(query)
End Sub
 
Upvote 0

ocalle

Active Member
Licensed User
Longtime User
Manfred, I just found the warning, i have one code module named sql, neverminds that name, but cannot see on screen editor. i renamed that and fix it. Thanks by your time and concern
 
Upvote 0
Top