perezstr

Getting a Search Cursor on a sde feature class

Discussion created by perezstr on Dec 8, 2010
Latest reply on Dec 15, 2010 by perezstr
I have four feature classes in a sde database that is versioned (9.3) and I want to get a searchcursor on a specific feature class.  I keep getting the "A locator with this name does not exist." error on the feature class I want.  The other three feature classes in the database are accessible through a search cursor only the one I want is not (of course it isn't!).  Why would three of four fc's be accessible and one of the four fc's would not be accessible?  I am able to get a describe object off all the fc's just not a search cursor.  Would it be because it is being accessed by people so there is a lock?  I figure the whole database would be locked.  But if I just want a search cursor does that lock it?  Here's my code.  Thanks in advance.

##for fc in gp.listfeatureclasses():
##    print fc
##    dsc = gp.describe(fc)
##    print dsc.spatialreference.name
##    flds = gp.listfields(fc)
##    blah = flds[0].name
##    print blah
##    rows = gp.searchcursor(fc)
##    row = rows.next()
##    while row:
##        print row.getvalue(blah)
##        row = rows.next()

Outcomes