Another search cursor error - cannot concatenate 'str' and 'Cursor' objects

300
1
Jump to solution
08-02-2012 06:45 AM
JonPedder
Occasional Contributor II
Sorry, yet another frustrating error I'm encountering.

I'm reading data from an Excel sheet, first column is xCel_Assignment_Number. Then will be matching the value from xCel_Assignment_Number to FC Assignments, field Assignment_Number. Then updating the information in the FC with data from the spreadsheet.

I'm again having trouble with the query and receive the error cannot concatenate 'str' and 'Cursor' objects. Assignment_Number is type short Integer.

Here's the code I'm using.

rows = arcpy.SearchCursor(xCel) row = rows.next() arcpy.AddMessage("Got Rows" + str(rows) +" from excel")  while row:     arcpy.AddMessage("Start While Loop processing excel sheet")      # Excel Sheet Values     eAssignment = row.getValue("xCel_Assignment_Number")     eDescription = row.getValue("xCel_Description")     eTeam = row.getValue("xCel_Team_Name")      fc1="Assignments"     vAssignment = '"Assignment_Number"' + "='" + str(int(eAssignment)) + "'"      arcpy.AddMessage(eAssignment)          iAssignment = arcpy.SearchCursor(fc1,eAssignment)          arcpy.AddMessage("iAssignment - " + iAssignment)


Thanks in advance for your help
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JonPedder
Occasional Contributor II
Sometimes it just takes a train ride to rethink the problem. It was actually the arcpy.addmessage that was teh issue, not the query.

Sorry to trouble you all

Jon

View solution in original post

0 Kudos
1 Reply
JonPedder
Occasional Contributor II
Sometimes it just takes a train ride to rethink the problem. It was actually the arcpy.addmessage that was teh issue, not the query.

Sorry to trouble you all

Jon
0 Kudos