1

I try to select line segments from a layer "t_Pavement_Line which is open in TOC using the following line:

    arcpy.SelectLayerByAttribute_management("t_Pavement_Line", "NEW_SELECTION", '"ROAD_CLASS" = \'%s\'' % classname)

I get this Error message:

    ExecuteError: ERROR 000622: Failed to execute (Select Layer By Attribute). Parameters are not valid.
ERROR 000628: Cannot set input into parameter in_layer_or_view.
4
  • 1
    Python can't find the feature layer t_Pavement_Line Commented May 8, 2015 at 23:00
  • 2
    I think you should edit your question to show how you made that feature layer. Commented May 9, 2015 at 11:49
  • Emil it seems that you were right, ArcMap can't find the database, although the .dbf file exists in the folder where the used .shp file is. I created a .lyr and it works now for some reason. Commented May 11, 2015 at 12:35
  • thanks everyone for the answers I don't think this question is answerable with the info I provided. the fix is easy. just update my current GIS map from our database. however it baffles why do i get the error in the first place.... Commented May 11, 2015 at 15:38

1 Answer 1

2

Follow the prompts to say, you should make sure your input parameters for errors, such as layer names, field names, etc. In addition, if your data is in GDB, then your field names do not need to use double quotes.

1
  • it seems that the problem is coming from referring to "t_Pavement_Line". I tried select by attribute from an arcMaps Model and gave me an error saying it cant find the Database Commented May 11, 2015 at 12:38

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.