I am trying to use InsertCurosr to transfer rows from one table to another. Yes I could just use append but I am trying to see if the InsertCurosr is faster but I am getting the error
"DescribeData: Method Field1AFieldName does not exist".
Here is what I have currently. The Source Label currently does not have Field1A, Target does have the Field1A field.
import arcpy,os
#### Transfer Source table rows into Target Table
arcpy.env.workspace = r'C:\Temp\Test.gdb'
Target = r"C:\Temp\Test.gdb\TargetTable"
Source = r"C:\Temp\Test.gdb\SourceTable"
arcpy.DeleteRows_management(Target)
dsc = arcpy.Describe(Target)
fields = dsc.fields
out_fields = [dsc.OIDFieldName, dsc.Field1AFieldName]
fieldnames = [field.name for field in fields if field.name not in out_fields]
with arcpy.da.SearchCursor(Source,fieldnames) as sCur:
with arcpy.da.InsertCursor(Target,fieldnames) as iCur:
for row in sCur:
iCur.insertRow(row)