I have an existing feature class in a file gdb. I am trying to write a python script to load data from a SQL2012 gdb. I am new to this. Normally, I would just drop a tool into modelbuilder and convert it to a python script. However, I do not know how to do this with the Simple data loader that I use in ArcCatalog. I would think that someone has already done this. Any help is appreciated.
Okay, so I wrote the script to load or append data to an existing feature class. First, I use arcpy.ListFeatureClasses and get a list of the feature classes from my source feature dataset. I then loop through each one of the feature classes in the list above and:
1. Use arcpy.Describe and create a list containing all of the field names in the source
2. Use arcpy.SearchCursor on my source feature dataset and for each row in this cursor I loop through and
3. Use arcpy.InsertCursor.newRow and create a new row in my target dataset
4. Then for each field name in the list of field names from 1. above I loop through and populate that field value in my new row with the value from the source (I use getValue and setValue)
5. Finally, I use the InsertCursor from 3. above and use the method insertRow to update the row in my target database.
6. I clean up my cursors.
This all works, however it takes a long time to do this.
Does anyone have any experience with tuning the python performance or suggestions for how to modify my logic above to increase performance?