tbl = r"C:\temp\temp.gdb\test_table" rows = arcpy.InsertCursor(tbl) row = rows.newRow() row.NAME = "TestName" rows.insertRow(row) print row.OBJECTID #This returns the following error: Runtime error <type 'exceptions.RuntimeError'>: Row: Field OBJECTID does not exist print row.NAME #This returns the same error for the NAME field even though I just set the value and the new row is definitely inserted in the table. ## I've also tried the following with no luck print row.getValue("OBJECTID") print row.getValue("NAME") print row.getValue(row.OBJECTID) print row.getValue(row.NAME)
hope that it'll be a bug that is fixed quickly
BTW: this is not a new issue: http://forums.esri.com/Thread.asp?c=93&f=1729&t=293522
Nope, as far as my attempts have gone, you can't do it (retrieve an insert cursor value like you can with an update cursor). So a v9.3 example:insertRows = gp.insertcursor(myTable) insertRow = insertRows.newrow() insertRow.MYFIELD = "my value" print insertRow.MYFIELD #THIS BOMBS!It's a bug.
insertRows = gp.insertcursor(myTable) insertRow = insertRows.newrow() insertRow.MYFIELD = "my value" print insertRow.MYFIELD #THIS BOMBS!
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.