Skip to main content
1 of 3
DenaliHardtail
  • 3.2k
  • 4
  • 36
  • 72

How do I create a new feature class from an existing FC and a WHERE clause?

I have a feature class. I want to copy the FC and use a WHERE clause to limit the rows copied. I tried using the CopyFeatures_management but it throws an error on the CopyFeatures_management() line.

Here's the code:

import arcpy

arcpy.env.workspace = 'C:/.../localFile.gdb'

inFC = 'inputFeatureClassName'
outFC = 'tmp_JUNK'

arcpy.CopyFeatures_management(inFC, outFC, '"FIELD_NAME" = "VALUE"')

The error thrown:

arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000800: The value is not a member of  | DEFAULTS | TEXT_UTF16 | MAX_FILE_SIZE_4GB | MAX_FILE_SIZE_256TB | GEOMETRY_OUTOFLINE | BLOB_OUTOFLINE | GEOMETRY_AND_BLOB_OUTOFLINE | TERRAIN_DEFAULTS | MOSAICDATASET_DEFAULTS | MOSAICDATASET_INLINE.
Failed to execute (CopyFeatures).

Any ideas what I'm doing wrong and how to fix it?

DenaliHardtail
  • 3.2k
  • 4
  • 36
  • 72