Advertisement
Guest User

Untitled

a guest
Oct 20th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. SELECT * FROM FeatureClass WHERE Field IN ('a', 'f', 'l')
  2.  
  3. gRoutes = ('R10T', 'R10TBP', 'R10TWP', 'R20T', 'R20TBP', 'R20TWP', 'R32T', 'R32TBP', 'R32TWP', 'R45T', 'R45TBY', 'R45TBP', 'R45TWP', 'R64T', 'R64TBP', 'R64TWP', 'R96T', 'R96TBP', 'R96TWP', 'R10TBY', 'R20TBY', 'R32TBY', 'R64TBY', 'R96TBY')
  4.  
  5. # field name
  6. QF1 = "Product_Code"
  7.  
  8. WC1 = '"' + QF1 + '" IN ' + "'" + gRoutes + "'"
  9.  
  10. arcpy.SelectLayerByAttribute_management("layerFC","REMOVE_FROM_SELECTION", WC1)
  11.  
  12. '"Product_Code" IN '['R10T', 'R10TBP', 'R10TWP', 'R20T', 'R20TBP', 'R20TWP', 'R32T', 'R32TBP', 'R32TWP', 'R45T', 'R45TBY', 'R45TBP', 'R45TWP', 'R64T', 'R64TBP', 'R64TWP', 'R96T', 'R96TBP', 'R96TWP', 'R10TBY', 'R20TBY', 'R32TBY', 'R64TBY', 'R96TBY']''
  13.  
  14. Start Time: Thu Oct 20 14:59:48 2016
  15. ERROR 000358: Invalid expression
  16. Failed to execute (SelectLayerByAttribute).
  17. Failed at Thu Oct 20 14:59:48 2016 (Elapsed Time: 0.02 seconds)
  18.  
  19. gRoutes = '('R10T', 'R10TBP', 'R10TWP', 'R20T', 'R20TBP', 'R20TWP', 'R32T', 'R32TBP', 'R32TWP', 'R45T', 'R45TBY', 'R45TBP', 'R45TWP', 'R64T', 'R64TBP', 'R64TWP', 'R96T', 'R96TBP', 'R96TWP', 'R10TBY', 'R20TBY', 'R32TBY', 'R64TBY', 'R96TBY')'
  20.  
  21. # field name
  22. QF1 = '"Product_Code"'
  23.  
  24. WC1 = QF1 + ' IN ' + gRoutes
  25.  
  26. arcpy.SelectLayerByAttribute_management("layerFC","REMOVE_FROM_SELECTION", WC1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement