Select to view content in your preferred language

SourceDefinitionQuery question

686
2
01-21-2022 09:51 AM
WendyBerelson
Occasional Contributor

Hi, I'm new to DLTs.  I am wondering if when you have 1=1 in the SourceDefinitionQuery cell does that delete/truncate the whole target dataset or only the values from the feature class in the source field? I have run the Data Loading Tools and realized that one of the fields was text not short so now I want to reload the data, but there is other data in there besides what I have just loaded and I don't want to delete that. 

 

 

 

 

0 Kudos
2 Replies
TedHoward2
Esri Contributor

Each query only applies to each respective source or target.

1=1 in SourceDefinitionQuery is the same as leaving it blank, meaning all records from the specified Source will be loaded to the Target.

1=1 in TargetDeleteQuery would delete every record in the Target before appending data from the Source. Leaving it blank would result in no Target records being deleted before append.

If you want to delete a subset of data in the Target, so you can reload it from the source, then a specific SQL query is needed in the TargetDeleteQuery cell. You might consider using a query against oid field to delete all the latest data appended in. Ex: OBJECTID > 123

You can always test your TargetDeleteQuery using arcpy.SelectLayerByAttribute_management.

WendyBerelson
Occasional Contributor

Thanks for clarifying @TedHoward2 

0 Kudos