SQL1.ExecNonQuery2

ciginfo

Well-Known Member
Licensed User
Longtime User
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
 

Mahares

Expert
Licensed User
Longtime User
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
Cookies are required to use this site. You must accept them to continue using the site. Learn more…