Android Question UPDATE DB

Mr Blue Sky

Active Member
Licensed User
Longtime User
Hi,

I can't understand where is my mistake, I not have a error message, just nothing is recorded in the database.

SQL1.ExecnonQuery2("UPDATE siteFolder SET RefPict = '1', MyPict = ? WHERE Ref = '%" & MyRefLink1 & "%' ", Array As Object(Data))
 

keirS

Well-Known Member
Licensed User
Longtime User
Assuming you are using % as a wildcard then your WHERE clause should be WHERE Ref LIKE.

B4X:
SQL1.ExecnonQuery2("UPDATE siteFolder SET RefPict = '1', MyPict = ? WHERE Ref  LIKE  '%" & MyRefLink1 & "%' ", Array As Object(Data))
 
Upvote 0

Mr Blue Sky

Active Member
Licensed User
Longtime User
Thank keirS for your valuable help,

for the community:

Sub Camera1_PictureTaken (Data() As Byte)
' --------------- Save Image to DB by UPDATE ---------------
SQL1.ExecnonQuery2("UPDATE TableName SET FieldNameString1 = '1', FieldNameBlob = ? WHERE FieldNameString2 LIKE '%" & MyRefLink1 & "%' ", Array As Object(Data))
camera1.StopPreview
camera1.Release
End Sub
 
Upvote 0

keirS

Well-Known Member
Licensed User
Longtime User
Your welcome. Just be aware that there is a 1mb limit for Blobs in cursors when reading them. See here for a work round.
 
Upvote 0

Mr Blue Sky

Active Member
Licensed User
Longtime User
Hi, i'm upgrade to Android SDK 7.1.1 and the code good before stop work now, i search to much solution and no understand all app it ok only UPDATE no work ?

SQL1.ExecnonQuery2("UPDATE TABLE SET ETIQUETTE = ? WHERE SITE LIKE '%" & MyRefPosition & "%' ", Array As String(MyRefValue))

android.database.sqlite.SQLiteDiskIOException: disk I/O error (code 1802)
#################################################################
Error Code : 1802 (SQLITE_IOERR_FSTAT)
Caused By : Failed to get database file information with system call stat(). Please confirm whether database file has been removed.
(disk I/O error (code 1802))
#################################################################
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…