AnsweredAssumed Answered

arcpy.da.instercursor adding blank rows.

Question asked by Shane.Lim@suez_na.com_SUEZNA on Sep 7, 2018
Latest reply on Sep 7, 2018 by Shane.Lim@suez_na.com_SUEZNA

I am trying to copy a table from an oracle server to a filegdb table.  I can get the searchcursor to work and I can get the insercursor to add all the rows but the field values are all blank.  Any ideas?

 

arcpy.CreateTable_management(targetPath,targetTableName,SourceTableFullPath,"#")

 

field_names = [f.name for f in arcpy.ListFields(SourceTableFullPath)] 

 

 

 


edit = arcpy.da.Editor(targetPath)

 

edit.startEditing(False,True)
edit.startOperation()
cursor = arcpy.da.InsertCursor(TargetTablefullPath,field_names)

 

i = 0
for row in arcpy.da.SearchCursor(SourceTableFullPath, field_names, sourceFilterString):
   i = i + 1

 

   print row[0] + " " + row[1]
   cursor.insertRow(row)
   if i > 10:
   print i
   break

 

print "added rows?"
edit.stopOperation()
edit.stopEditing(True)

 

del row
del cursor

Outcomes