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
    Looks like you have a number of attempts above. Please edit to be sure you're including only the exact code that's failing and the exact corresponding error message. Also let us know if IrfanTable1 is a table, a feature class, or something else. – Andy Feb 13 at 19:34
  • I have the working lines commented out, as you can see. That was just to show that the paths are correct but copying 'IrfanTable1', which is a Table is failing but copying Feature Class is working. – IrfanClemson Feb 13 at 19:35

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")

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.