S sigster Active Member Licensed User Longtime User Jul 8, 2020 #1 Hi I am try to UPDATE I get no error and the data don't change are any example how to INSERT, UPDATE using jdbcSQL and MYSQL B4X: Dim sf As Object = Starter.mysql.ExecQueryAsync("mysql","UPDATE testtable SET id=?,name=? ,address=? WHERE id=? ", _ Array As Object("","name","address","1", Null)) Wait For (sf) mysql_QueryComplete (Success As Boolean, Crsr As JdbcResultSet)
Hi I am try to UPDATE I get no error and the data don't change are any example how to INSERT, UPDATE using jdbcSQL and MYSQL B4X: Dim sf As Object = Starter.mysql.ExecQueryAsync("mysql","UPDATE testtable SET id=?,name=? ,address=? WHERE id=? ", _ Array As Object("","name","address","1", Null)) Wait For (sf) mysql_QueryComplete (Success As Boolean, Crsr As JdbcResultSet)
DonManfred Expert Licensed User Longtime User Jul 8, 2020 #2 id is autoincrement. You can NOT SET a value for it sigster said: Dim sf As Object = Starter.mysql.ExecQueryAsync("mysql","UPDATE testtable SET id=?,name=? ,address=? WHERE id=? ", _ Array As Object("","name","address","1", Null)) Click to expand... so the 1st ? is not right. Even the query and parameters B4X: Dim sf As Object = Starter.mysql.ExecQueryAsync("mysql","UPDATE testtable SET name=? ,address=? WHERE id=? ", _ Array As Object("name","address","1")) Last edited: Jul 8, 2020 Upvote 0
id is autoincrement. You can NOT SET a value for it sigster said: Dim sf As Object = Starter.mysql.ExecQueryAsync("mysql","UPDATE testtable SET id=?,name=? ,address=? WHERE id=? ", _ Array As Object("","name","address","1", Null)) Click to expand... so the 1st ? is not right. Even the query and parameters B4X: Dim sf As Object = Starter.mysql.ExecQueryAsync("mysql","UPDATE testtable SET name=? ,address=? WHERE id=? ", _ Array As Object("name","address","1"))
S sigster Active Member Licensed User Longtime User Jul 8, 2020 #3 Thanks the data still don't upgrade B4X: If Starter.mysql.IsInitialized = False Then Wait For (CallSub(Starter,"Connect")) Complete (Success As Boolean) If Success Then Log("Connected") End If Else Log("No") End If Dim sf As Object = Starter.mysql.ExecQueryAsync("mysql","UPDATE testtable SET name=? ,address=? WHERE id=? ", Array As Object("name1","address1","1")) Wait For (sf) mysql_QueryComplete (Success As Boolean, Crsr As JdbcResultSet) If Success Then Log("1") Else Log("2") End If Upvote 0
Thanks the data still don't upgrade B4X: If Starter.mysql.IsInitialized = False Then Wait For (CallSub(Starter,"Connect")) Complete (Success As Boolean) If Success Then Log("Connected") End If Else Log("No") End If Dim sf As Object = Starter.mysql.ExecQueryAsync("mysql","UPDATE testtable SET name=? ,address=? WHERE id=? ", Array As Object("name1","address1","1")) Wait For (sf) mysql_QueryComplete (Success As Boolean, Crsr As JdbcResultSet) If Success Then Log("1") Else Log("2") End If
DonManfred Expert Licensed User Longtime User Jul 8, 2020 #4 sigster said: ExecQueryAsync Click to expand... UPDATE is not a query which returns anything. Use ExecNonQuery2 Upvote 0
sigster said: ExecQueryAsync Click to expand... UPDATE is not a query which returns anything. Use ExecNonQuery2
DonManfred Expert Licensed User Longtime User Jul 8, 2020 #5 sigster said: ExecQueryAsync Click to expand... I did n´t pay enough attention on your code above. Just posted my answer about the wrong query. UPDATE is not a query which returns anything. You need to use ExecNonQuery2 Upvote 0
sigster said: ExecQueryAsync Click to expand... I did n´t pay enough attention on your code above. Just posted my answer about the wrong query. UPDATE is not a query which returns anything. You need to use ExecNonQuery2
S sigster Active Member Licensed User Longtime User Jul 8, 2020 #6 I am not Experts any change you can help me with this Invalid number of parentheses B4X: Starter.mysql.ExecNonQuery2("mysql", "UPDATE testtable SET name=? ,address=? WHERE id=? ", Array As Object("name1","address1","1", Null) Upvote 0
I am not Experts any change you can help me with this Invalid number of parentheses B4X: Starter.mysql.ExecNonQuery2("mysql", "UPDATE testtable SET name=? ,address=? WHERE id=? ", Array As Object("name1","address1","1", Null)
DonManfred Expert Licensed User Longtime User Jul 8, 2020 #7 Oh my god....I suggest to learn the basics.. You have two opening "(" but only one closing ")" Add a ) at the end. Expect this my last answer. Last Note: REMOVE the null in your parameters! You have 3 questionsmarks (?) but you give FOUR parameters. I already fixed this problem above. Your query was ok in #3. But now you added null again. Why? Last edited: Jul 8, 2020 Upvote 0
Oh my god....I suggest to learn the basics.. You have two opening "(" but only one closing ")" Add a ) at the end. Expect this my last answer. Last Note: REMOVE the null in your parameters! You have 3 questionsmarks (?) but you give FOUR parameters. I already fixed this problem above. Your query was ok in #3. But now you added null again. Why?
S sigster Active Member Licensed User Longtime User Jul 8, 2020 #8 I can close this like this but not if I use "mysql", "UPDATE Communications link failure if I skip "mysql" B4X: Starter.mysql.ExecNonQuery2("UPDATE testtable SET name=? ,address=? WHERE id=? ", Array As Object("name1","address1","1")) Upvote 0
I can close this like this but not if I use "mysql", "UPDATE Communications link failure if I skip "mysql" B4X: Starter.mysql.ExecNonQuery2("UPDATE testtable SET name=? ,address=? WHERE id=? ", Array As Object("name1","address1","1"))