Android Question UPDATE statement for a picture/blob

RhodesB4A

Member
Licensed User
Longtime User
Hi,

The update statement does not seem to work for updating (replacing in this case) a picture that's already sitting in the DB. The insert statement works just fine though. Below is the code I use. Thanks in advance.


B4X:
Main.aSQL.ExecNonQuery("UPDATE product SET Name = '" & txtEDITName.Text & "' , Price = " & txtEDITprice.Text & " , Size = " & txtEDITSize.Text & ", Type = '" & txtEDITType.Text & " , Picture = " & Array As Object(Buff) & " WHERE ProductID = " & theProdID)
 

dxxxyyyzzz

Member
Licensed User
Longtime User
Try:
B4X:
Main.aSQL.ExecNonQuery2("UPDATE product SET Name=?, Price=?, Size=?, Type=?, Picture=? WHERE ProductID='" & theProdID & "'", Array As Object( txtEDITName.Text, txtEDITprice.Text, txtEDITSize.Text, txtEDITType.Text, Buffer))
 
Upvote 0
Top