Hi all,
Following this forum exemples, I did this test :
Output result for 'id' is always 0 !!!
I have also tried this syntax :
Same problem !!
does anybody knows whats wrong :BangHead:
Thks,
William.
Following this forum exemples, I did this test :
B4X:
SQL1.Initialize(File.DirRootExternal, "bar.db", True)
SQL1.ExecNonQuery("CREATE TABLE conso (id INTEGER UNSIGNED AUTO_INCREMENT, date DATE, observation TEXT)")
SQL1.ExecNonQuery("INSERT INTO conso VALUES(NULL, '01/01/13', 'Obs 1')")
SQL1.ExecNonQuery("INSERT INTO conso VALUES(NULL, '02/01/13', 'Obs 2')")
Cursor1 = SQL1.ExecQuery("SELECT id, date,observation FROM conso")
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
Log(Cursor1.Position)
Log(Cursor1.GetInt("id"))
Log(Cursor1.GetString("date"))
Log(Cursor1.GetString("observation"))
Next
Cursor1.Close
I have also tried this syntax :
B4X:
SQL1.ExecNonQuery2("INSERT INTO conso VALUES(?, ?, ?)", Array As Object(Null, "01/01/13", "Obs 1"))
does anybody knows whats wrong :BangHead:
Thks,
William.