Android Question How to empty a filled in SQLite Blob field

albert1963

Member
Licensed User
Longtime User
I use the following code to fill a taken picture into a SQLite Blob field:

B4X:
                OutputStream1.InitializeToBytesArray(1024)
                File.Copy2(InputStream1, OutputStream1)
                Buffer = OutputStream1.ToBytesArray
                Dim MyStringUtilities As StringUtils
                Dim PictureBuffer As String = MyStringUtilities.EncodeBase64(Buffer)
               MySqlquery = "UPDATE " & DbMainTableName & _
                            " SET " & MainTableColumnNames(FotoIndex) & " = '" & PictureBuffer & "' " & _
                            "WHERE " & MainTableColumnNames(0) & " = '" & txtMainTableColumnNames0.Text & _
                            "' AND " & MainTableColumnNames(3) & " = '" & TxtProjectReferentie.Text & _
                            "' AND " & MainTableColumnNames(7) & " = '" & TxtSerienummer.Text & "'"
                MySql.ExecNonQuery(MySqlquery)

Question:
How can I empty this Blob, when the picture is removed by the user, i.e. should the PictureBuffer be empty (using = "")? Using this does not empty the field and also does not give any error. What am I doing wrong in this case?
 
Top