What can be loaded into a record set?

854
2
12-16-2010 04:00 AM
ChrisMathers
Occasional Contributor III
I can make a record set from a feature class in catalog, but cant seem to use the RecordSet class in python. The help for the class says that the load property can "Import a feature class into the RecordSet object." Trying to do this in python returns the error "Cannot load a feature class into a RecordSet." Any ideas?

I have tried:
recordset=arcpy.RecordSet(r'\\Bay-gis\GIS Staff\Parcel_Processor.gdb\Target_Data\parcels_loaded')
and
recordset=arcpy.RecordSet()
recordset.load(r'\\Bay-gis\GIS Staff\Parcel_Processor.gdb\Target_Data\parcels_loaded')
Tags (2)
0 Kudos
2 Replies
AlessandroCinnirella
New Contributor III
did you try the append function?
arcpy.Append_management()

ciao
0 Kudos
KevinHibma
Esri Regular Contributor
Chris,

I've searched the help and can't find where you reference that you should be able to import a featureclass into a recordset.
However - I agree you should be able to do this. Like you said, you can do it in ModelBuilder from ArcMap. Also as a note, I dont think this is an arcpy issue, its probably been like this back since the time of import arcgisscripting (gp.RecordSet)

I just logged the bug - Sorry I cant post the Nim as I'm heading on holidays and dont have time to wait for it to export 🙂 (it is in the system though)

However, as a work around you should be able to do an arcpy.CopyRows(..... "in_memory\table")
And then do your record set from that.
It isn't great, but should keep you moving on your workflow.
0 Kudos