I have two tables with a common ID field that I would like to merge.
Is it possible to do this through python OGR? I am attempting to use the ExecuteSQL() command but am getting an error that table2 doesn't exist.
Here is my code:
connection = ogr.Open(connString) connection2 = ogr.Open(connString2) layer1 = connection.GetLayer() layer2 = connection2.GetLayer() newlayer = connection.ExecuteSQL("SELECT table1.field1, table1.field2, table2.field2 FROM table1 INNER JOIN table2 ON table1.field1 = table2.field1", dialect = "SQLITE")
Is this something that can be done through OGR? Or should I be looking into something else?