L ljcomp Member Licensed User Longtime User Mar 1, 2012 #1 Hi All I have a simple database the table has been created:- B4X: SQL1.ExecNonQuery("CREATE TABLE IF NOT EXISTS tree (ID INTEGER PRIMARY KEY , common TEXT , botanical TEXT)") I now need to insert as:- B4X: SQL1.ExecNonQuery2("INSERT INTO tree VALUES('id', ?, ?)", Array As Object(TreeText1.Text, TreeText2.text )) This doesn't work. Can anyone show me how I should insert to the table correctly. I want the ID col to be auto increment as primary key. Cheers LJ
Hi All I have a simple database the table has been created:- B4X: SQL1.ExecNonQuery("CREATE TABLE IF NOT EXISTS tree (ID INTEGER PRIMARY KEY , common TEXT , botanical TEXT)") I now need to insert as:- B4X: SQL1.ExecNonQuery2("INSERT INTO tree VALUES('id', ?, ?)", Array As Object(TreeText1.Text, TreeText2.text )) This doesn't work. Can anyone show me how I should insert to the table correctly. I want the ID col to be auto increment as primary key. Cheers LJ
Erel B4X founder Staff member Licensed User Longtime User Mar 1, 2012 #2 Here: B4X: "INSERT INTO tree VALUES(null, ?, ?)", Array As Object(TreeText1.Text, TreeText2.text )) Upvote 0