angelone Member Licensed User Longtime User Apr 15, 2016 #1 The values that I want to insert into the database queries are entered by user in a textebox . Which is the right syntax to include them ? For example, ' Jane ' and ' Jones ' are the values that I should have in textbox 'insert data and the image to the database SQL1.ExecNonQuery2("INSERT INTO Persons VALUES( NULL, 'Jane', 'Jones' ,?)", Array As Object(Buffer))
The values that I want to insert into the database queries are entered by user in a textebox . Which is the right syntax to include them ? For example, ' Jane ' and ' Jones ' are the values that I should have in textbox 'insert data and the image to the database SQL1.ExecNonQuery2("INSERT INTO Persons VALUES( NULL, 'Jane', 'Jones' ,?)", Array As Object(Buffer))
DonManfred Expert Licensed User Longtime User Apr 15, 2016 #2 Something like this i guess (not using much with database on android) B4X: SQL1.ExecNonQuery2("INSERT INTO Persons VALUES( NULL, ?, ? ,?)", Array As Object(myedit1.text, myedit2.text, Buffer)) Upvote 0
Something like this i guess (not using much with database on android) B4X: SQL1.ExecNonQuery2("INSERT INTO Persons VALUES( NULL, ?, ? ,?)", Array As Object(myedit1.text, myedit2.text, Buffer))
Lahksman Active Member Licensed User Longtime User Apr 15, 2016 #3 Is it just one textbox? Because in that case you would need to split the text into different variables. Upvote 0
Is it just one textbox? Because in that case you would need to split the text into different variables.
DonManfred Expert Licensed User Longtime User Apr 15, 2016 #4 then split the input by yourself to get two variables which you then can use in your query. Upvote 0
angelone Member Licensed User Longtime User Apr 15, 2016 #5 Ok, thank's a lot, it work perfect. If i want also change the Table of the database i have to do in the same way? SQL1.ExecNonQuery2("INSERT INTO " & myesit3.text & " VALUES( NULL, ?, ? ,?)", ArrayAs Object(myedit1.text, myedit2.text, Buffer)) Upvote 0
Ok, thank's a lot, it work perfect. If i want also change the Table of the database i have to do in the same way? SQL1.ExecNonQuery2("INSERT INTO " & myesit3.text & " VALUES( NULL, ?, ? ,?)", ArrayAs Object(myedit1.text, myedit2.text, Buffer))
DonManfred Expert Licensed User Longtime User Apr 15, 2016 #6 Learn SQL basics! Insert always INSERTS a new entry. Which command is used to update one or more entries in a table? But if you are talking about the principle of using parametrized parameters. Yes, this will work with update and delete statements as well. Upvote 0
Learn SQL basics! Insert always INSERTS a new entry. Which command is used to update one or more entries in a table? But if you are talking about the principle of using parametrized parameters. Yes, this will work with update and delete statements as well.