ciginfo Well-Known Member Licensed User Longtime User Jul 30, 2012 #1 Hello, Why it does not work? B4X: SQL1.ExecNonQuery("CREATE TABLE table1 (ID AUTO_INCREMENT PRIMARY KEY, MaDate LONG, MonNom TEXT, MaLongitude DOUBLE, MaLatitude DOUBLE)") SQL1.ExecNonQuery2("INSERT INTO table1 VALUES(Null, ?, ?, ?, ?)", Array As Object( now, nomchamp, longi, lati)) In every row ID = 0. ID does not incremented for each record but remains at 0
Hello, Why it does not work? B4X: SQL1.ExecNonQuery("CREATE TABLE table1 (ID AUTO_INCREMENT PRIMARY KEY, MaDate LONG, MonNom TEXT, MaLongitude DOUBLE, MaLatitude DOUBLE)") SQL1.ExecNonQuery2("INSERT INTO table1 VALUES(Null, ?, ?, ?, ?)", Array As Object( now, nomchamp, longi, lati)) In every row ID = 0. ID does not incremented for each record but remains at 0
M Mahares Expert Licensed User Longtime User Jul 30, 2012 #2 Try the below. It will work for you. It will auto increment for you: B4X: SQL1.ExecNonQuery("CREATE TABLE table1 (ID INTEGER PRIMARY KEY, MaDate LONG, MonNom TEXT, MaLongitude DOUBLE, MaLatitude DOUBLE)") SQL1.ExecNonQuery2("INSERT INTO table1 VALUES(Null, ?, ?, ?, ?)", Array As Object( now, nomchamp, longi, lati)) Bonne journee Upvote 0
Try the below. It will work for you. It will auto increment for you: B4X: SQL1.ExecNonQuery("CREATE TABLE table1 (ID INTEGER PRIMARY KEY, MaDate LONG, MonNom TEXT, MaLongitude DOUBLE, MaLatitude DOUBLE)") SQL1.ExecNonQuery2("INSERT INTO table1 VALUES(Null, ?, ?, ?, ?)", Array As Object( now, nomchamp, longi, lati)) Bonne journee