Hi everyone,
I'm stuck on a situation that I feel I'm making more complicated than it needs to be.
Situation:
I have a database (700K records) that updates daily, I convert it to a spatial dataframe. I have a hosted feature layer (points) that updates daily. Right now I truncate and append the entire thing, but having it empty for a while isn't ideal.
I want to basically this:
- For each row in the database, search for the same 'key' in the hosted.
- If return clause = 1
- If any of the fields have different values, then update that field (or just the entire row)
- else
- If return clause = 0
- insert cursor to insert that row
- else next row
Where I am getting confused is, does the da.cursor just use field position to insert values? row[19] will update the 19th column. But what if someone inserts a new column in the database, would everything get screwed up? Can I instead just match the field names with a field map?