Android Question Insert list of records from MYSQL (Check if exist)

vdudukov

Member
Licensed User
Longtime User
Hi,

I am trying to insert list of records from MYSQL database to SQLite.
I did it with this code:

B4X:
Case: "updateSQLite"

                Dim ListOfProducts As List
                ListOfProducts = parser.NextArray 'returns a list with maps
                DBUtils.InsertMaps(SQLite,"products",ListOfProducts)
               
End Select

Now i want to check every record if exist in my SQlite database. If do not exist, then insert, if exist then return.

How can I do this ?

Thanks.
 

sorex

Expert
Licensed User
Longtime User
you will need to do it in your own loop and use a select statement to see if that record/product already exist.
 
Upvote 0
Top