dimanche 21 février 2016

sqlite insert android three rows instead one

I'm trying to insert one row with id and timestamp into a sqlite database by clicking in my android app on virtual device.

private final String create_table = "CREATE TABLE clicks ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, timestamp INTEGER(4) NOT NULL);";

db.execSQL("insert into clicks(timestamp) values (strftime(\"%s\", CURRENT_TIME));");

When I run the app inserts three rows into the db instead of one row?

Any suggestion? Thank you. Ramon.

Aucun commentaire:

Enregistrer un commentaire