Very new to Python. I am trying to copy between Feature Datasets, Feature Classes, and Tables between two GDBs. Here's my code:
The following attempt works when Irfan_FC
is a feature class:
#Copy Feature Class [Works]
gp.CopyFeatures_management(r"C:\path\_FGB.gdb\Irfan_FC", r"C:\path\OUTPUT\db_output.gdb\Irfan_FC")
The attempt fails when IrfanTable1
is a table:
#Copy Table [Fails]
gp.CopyFeatures_management(r"C:\path\Irfan_Simple_Input_TBL.gdb\IrfanTable1", r"C:\path\OUTPUT\db_output.gdb\IrfanTable1"
ERROR 000732: Input Features: Dataset C:\AGOL_Backup\Data\Irfan_Simple_Input_TBL.gdb\IrfanTable1 does not exist or is not supported
Eventually, this code will copy from a flat GDB (no datasets) into a target GDB which will have datasets but right now I will be happy to copy just tables.
1 Answer 1
Problem with my code was that I was using the 'CopyFeatures_management
' function, which seems to expect a 'Feature Class' but I was trying to copy a static table. The code below copies static tables and is working for me.
gp.CopyRows_management(r"C:\path\Irfan_Simple_Input_TBL.gdb\IrfanTable1", r"C:\path\OUTPUT\db_output.gdb\IrfanTable1")
Explore related questions
See similar questions with these tags.
IrfanTable1
is a table, a feature class, or something else.