Hi, the following code inserts a BLOB:
However, I have a table that has 6 fields: id, img1, img2, img3, img4, img5
How can I insert the BLOB into a specific field, say "img3"?
Also, what would the syntax be to UPDATE / SET a BLOB in a specific field?
My code is:
B4X:
SQL1.ExecNonQuery2("INSERT INTO table2 VALUES('smiley', ?)", Array As Object(Buffer))
How can I insert the BLOB into a specific field, say "img3"?
Also, what would the syntax be to UPDATE / SET a BLOB in a specific field?
My code is:
B4X:
Dim InputStream1 As InputStream
InputStream1 = File.OpenInput(File.DirAssets, "yelloe icone empty - copy.png")
Dim OutputStream1 As OutputStream
OutputStream1.InitializeToBytesArray(1000)
File.Copy2(InputStream1, OutputStream1)
Dim Buffer() As Byte 'declares an empty array
Buffer = OutputStream1.ToBytesArray
'write the image to the database at position "img3"