Truncates and appends data from one object to another.
| Parameter | Type | Description | Required |
|---|---|---|---|
| SourceObject | String | Path to the source geodatabase object. | Yes |
| DestinationObject | String | Path to the destination/target geodatabase object. | Yes |
| SourceObjectCount | Integer | Number of records that must be in the SourceObject before beginning the process.
|
No |
| ObjectsSchemaTest | Boolean | The schema/fields of the input data must match the schema/fields of the target data.
|
No |
| DestUpdateField | String | Provide the name of a field in the DestinationObject.
|
No |
| FieldMappings | Field Mapping | Can only be used if ObjectsSchemaTest is False. | No |
| Subtype | String | A subtype description to assign that subtype to all new data that is appended to the target dataset. | No |
Returns: Boolean
Simple call with all parameters specified.
import RPLib # SDE SourceObject Source = "C:/GIS/GISADMIN@GIS.sde/GISADMIN.Parcels" # File gdb DestinationObject Destination = "Z:/LandRecords.gdb/Parcels" # File gdb, field in Parcels that is of type Date DateField = "LASTUPDATED" RPLib.truncateappend(Source,Destination,"100000",False,DateField)
Simple call with only required parameters specified.
import RPLib # SDE SourceObject Source = "C:/GIS/GISADMIN@GIS.sde/GISADMIN.Parcels" # File gdb DestinationObject Destination = "Z:/LandRecords.gdb/Parcels" RPLib.truncateappend(Source,Destination)
If Else logic with all parameters specified.
import RPLib # SDE SourceObject Source = "C:/GIS/GISADMIN@GIS.sde/GISADMIN.Parcels" # File gdb DestinationObject Destination = "Z:/LandRecords.gdb/Parcels" # File gdb, field in Parcels that is of type Date DateField = "LASTUPDATED" if RPLib.truncateappend(Source,Destination,"100000",False,DateField): print("successful, run another tool") else: print("failed, run another tool")
- Notice you do not need to specify these parameters because by default:
- SourceObjectCount = 0
- ObjectsSchemaTest = False
- DestUpdateField = None
- FieldMappings = None
- Subtype = None
import RPLib # SDE SourceObject Source = "C:/GIS/GISADMIN@GIS.sde/GISADMIN.Parcels" # File gdb DestinationObject Destination = "Z:/LandRecords.gdb/Parcels" # File gdb, field in Parcels that is of type Date DateField = "LASTUPDATED" if RPLib.truncateappend(Source,Destination): print("successful, run another tool") else: print("failed, run another tool")