I am trying to UPDATE records in a SQLite table.
I need to update all the records in table "user" where the field "IDNo" is equal to "MyIDNo".
This code creates an error - I think there is a syntax problem with "WhereFields"?
I need to update all the records in table "user" where the field "IDNo" is equal to "MyIDNo".
This code creates an error - I think there is a syntax problem with "WhereFields"?
B4X:
Dim ListOfMaps As List
ListOfMaps.Initialize
Dim m As Map
m.Initialize
m.Put("ID", MyID)
m.Put("FirstName", MyFirstName)
m.Put("LastName", MyLastName)
m.Put("IDNo", MyIDNo)
m.Put("School", MySchool)
m.Put("StudentNo", MyStudentNo)
m.Put("Grade", MyGrade)
m.Put("Add1", MyAdd1)
m.Put("Add2", MyAdd2)
m.Put("Town", MyTown)
m.Put("Province", MyProvince)
m.Put("PhoneNo", MyPhoneNo)
m.Put("Email", MyEmail)
m.Put("parentphone", ParentPhone)
m.Put("parentemail", ParentEmail)
m.Put("parenteid", ParentID)
m.Put("DateRegsitered", DateReg)
ListOfMaps.Add(m)
Dim WhereFields As Map
WhereFields.Initialize
WhereFields.Put("IDNo", MyIDNo)
DBUtils.UpdateRecord2(SQL0, "user", ListOfMaps, WhereFields)
ListOfMaps.Clear