I created a DB with the "DB Browser for SQLite" software. At the picture attached you can see two tables with their primary keys fields.
If I insert a new register, the ID primary key field keeps empty
B4X:
SQL1.ExecNonQuery2("INSERT INTO referencia VALUES(null,?,?,?)", Array As Object(txtREFERENCIA.Text, txtMAQUINA.text, txtPUESTO.Text))
For i =0 To lstMOVIMIENTOS.Size - 1
SQL1.ExecNonQuery2("INSERT INTO movimientos VALUES(null,?,?,?)", Array As Object(1, lstMOVIMIENTOS.GetItem(i), lstTMTP.GetItem(i)))
Next
Hello,
My first column in all my databases (SQLite, MySQL, MSSQL etc) is called id. In SQLite it would be created as follows, thus the id column will always auto increment.
Hello,
My first column in all my databases (SQLite, MySQL, MSSQL etc) is called id. In SQLite it would be created as follows, thus the id column will always auto increment.
I didn't say that it was. I was just saying that the above line is mandatory in all my databases and it works perfect, so just add AUTOINCREMENT NOT NULL and give it a go
I didn't say that it was. I was just saying that the above line is mandatory in all my databases and it works perfect, so just add AUTOINCREMENT NOT NULL and give it a go
Ups, Ok. The problem is that I had created the table with a external software. Is it possible to determine the primary key once the table has been created before?