Android Question RDC - How to write an UPDATE statement?

Harris

Expert
Licensed User
Longtime User
My code..

B4X:
If EditCurr = True Then
    EditCurr = False
    Dim cmd As DBCommand
    cmd.Initialize
    cmd.Name = "update_user"
    cmd.Parameters = Array As Object(et_id.Text,et_pin.Text,et_fname.Text,et_lname.Text,Null,et_rate.Text,et_email.Text,CurrPK)
    Main.reqManager.ExecuteCommand( cmd, Null)
 End If

RDC server side

B4X:
sql.update_user=UPDATE Emp SET (empno,pin,firstname,lastname,pic,rate,email,PK) VALUES (?,?,?,?,?,?,?) Where PK = ?


I get error:
B4X:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(empno,pin,firstname,lastname,pic,rate,email,PK) VALUES ('982322111','122222','y' at line 1

Or does one need to write a BatchCommand?

Thanks
 

Harris

Expert
Licensed User
Longtime User
Sorry all, my bad...
Set update statement on server to:

sql.update_user=UPDATE Emp SET empno =?,pin = ?,firstname = ?,lastname = ?,pic = ?,rate = ?,email = ? Where PK = ?

All is fine. Thanks
 
Upvote 0
Top