Select to view content in your preferred language

Batch Processing in Model Builder - Delete rows then Append

5725
14
02-25-2016 03:21 PM
SanhitaChatterjee1
Deactivated User

I am trying to delete rows from multiple feature classes with prefix TCEMaster_* (such as TCEMaster_Centerline, TCEMaster_Fence etc.) in TCEMaster.SDE ----then append the feature classes with data from another sde. Names of the feature classes in Input dataset is without the prefix (such as Centerline, Fence etc.).

My ultimate goal is to run a script/batch file routinely.

Should I use modelbuilder with Iterator and then export to python or a script in python. I am not much of an expert in python. See attached what I got started in modelbuilder.  I  have also attached a screenshot of the databases exported to FGDB  for testing purposes. Target dataset is TCEMaster in test_TCE.gdb and input dataset is R0007199 in test.gdb.

Any help will be highly appreciated.

0 Kudos
14 Replies
SanhitaChatterjee1
Deactivated User

Actually I will have to copy data to a dataset with "TCEMaster_*" prefix on all feature classes. I will have to use the wildcard.

0 Kudos
MichaelVolz
Esteemed Contributor

What version of ArcGIS are you working in?

0 Kudos
SanhitaChatterjee1
Deactivated User

10.2.1

0 Kudos
MichaelVolz
Esteemed Contributor

Maybe it has something to do with the naming convention  of feature classes within feature datasets where you need to specify both in the path.

Can you put in some print statements to check that the path to your input data and output data are correct with respect to the feature dataset and feature classes within the feature dataset?

I put a wildcard into my script which worked, so I don't think it's the wildcard that is the problem here.  I'm thinking it does not see any objects with the name you are specifying because you might not be including the feature dataset portion of the path.

0 Kudos
BlakeTerhune
MVP Regular Contributor

Are those TCE feature classes versioned? If not, using truncate is faster than delete rows.

Also, if you want to run this as a scheduled job, you'll need to use Python​.

0 Kudos