Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. arcpy.TableToTable_conversion("FINAL_NLPG", myTempWorkspace,outputTable)
  2.  
  3. for file in list_files:
  4. if file.startswith("Type_15"):
  5. arcpy.CopyRows_management(myDataSource + os.sep + file, r"in_memoryt15") #Row created to get a OID in table
  6. arcpy.MakeTableView_management(r"in_memoryt15","T15_view")
  7. if file.startswith("Type_21"):
  8. arcpy.CopyRows_management(myDataSource + os.sep + file, r"in_memoryt21")#Row created to get a OID in table
  9. arcpy.MakeTableView_management(r"in_memoryt21","T21_view")
  10. if file.startswith("Type_24"):
  11. arcpy.CopyRows_management(myDataSource + os.sep + file, r"in_memoryt24")#Row created to get a OID in table
  12. arcpy.MakeTableView_management(r"in_memoryt24","T24_view")
  13.  
  14. #Join Table 15 with Table 24 based on USRN
  15. arcpy.AddJoin_management("T24_view", "USRN", "T15_view", "USRN", "KEEP_COMMON")
  16.  
  17. #Join Table 21 with Table 24 based on UPRN
  18. arcpy.AddJoin_management("T24_view", "t24.UPRN", "T21_view", "UPRN", "KEEP_COMMON")
  19.  
  20. arcpy.MakeTableView_management("T24_view","FINAL_NLPG","OBJECTID < 1000","") ## <1000 to see if the code works
  21. arcpy.TableToTable_conversion("FINAL_NLPG", myTempWorkspace,outputTable) # FAILS HERE
  22. arcpy.TableToTable_conversion("FINAL_NLPG", "in_memory",outputTable) #saving to in_memory --- SAME PROBLEM
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement