Android Question Problem with SQLITE ExecQuery2

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
B4X:
'In sqlite datetype field is integer
Sub GetTitles(datetype As Int) As Cursor

    Dim table As Cursor

   'It does not work.
    table=SQL1.ExecQuery2("SELECT title FROM titles WHERE datetype=?;", Array As Object(datetype))
   
   'It works. ----> Array As String
    table=SQL1.ExecQuery2("SELECT title FROM titles WHERE datetype=?;", Array As String(datetype))

    return table

End sub

Why?
 

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
SQL.ExecQuery2 expects an array of strings not objects. You can see it in the method signature.
Thank you.
ok , but considering I want to pass only integers converts them in strings is not a bad practice? ( Sqlite point of view )
 
Upvote 0
Top