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?
field_names = [f.name for f in arcpy.ListFields(SourceTableFullPath)]
edit = arcpy.da.Editor(targetPath)
cursor = arcpy.da.InsertCursor(TargetTablefullPath,field_names)
i = 0
for row in arcpy.da.SearchCursor(SourceTableFullPath, field_names, sourceFilterString):
i = i + 1
print row + " " + row
if i > 10:
print "added rows?"
I didn't have any of that in to begin with. I just started at creating the cursor but I still have the same problem. I also tried doing it to a personal GDB. All I can think of is that the new table gets an objectid field and somehow that is messing with the field count but even when I only call out two fields manually they still go in blank.
I ended up creating a second copy of the table to insert into. The first table is somehow read only.
outTbl = str(arcpy.CreateTable_management(targetPath,targetTableName,SourceTableFullPath,"#").getOutput(0))
outTable2 = str(arcpy.TableToTable_conversion(outTbl,targetPath, targetTableName2 ).getOutput(0))