AnsweredAssumed Answered

RegisterWithGeodatabase() takes at most 1 argument

Question asked by SamANB on Aug 4, 2017
Latest reply on Aug 4, 2017 by vangelo-esristaff

I want to register a view to the Geodatabase. 

Since it's a view, I have to pass trough the second parameter with the ObjectID-column.

However, if I passtrough more than one paremeter, I get the error "RegisterWithGeodatabase() takes at most 1 argument".

 

I followed the example from Register with Geodatabase—Data Management toolbox | ArcGIS Desktop:

# RegisterWithGeodatabase.py
# Description: Simple example showing use of RegisterWithGeodatabase tool

# Import system modules
import arcpy

# Set variables
inTable = r"F:\DatabaseConnections\ANB-SQL-001_ANBGISv10_ISANBGIS.sde\V_BEHEEREENHEDEN_IVANHO_TEST1"
oid_field = "OBJECTID"
shape_field = "Shape"
geometry_type = "POLYGON"
sr = arcpy.SpatialReference(31370)
in_extent = "17736.0314 23697.0977 297289.9391 245375.4223"

# Process: Register With Geodatabase
arcpy.RegisterWithGeodatabase_management(inTable, oid_field, shape_field, geometry_type, sr, in_extent)

 

#Process: Use the CreateArcSDEConnectionFile function
#arcpy.RegisterWithGeodatabase_management (inTable, oid_field, shape_field)

 

 

 

This is the complete error:

Traceback (most recent call last):
File "C:\register.py", line 16, in <module>
arcpy.RegisterWithGeodatabase_management(inTable, oid_field, shape_field, geometry_type, sr, in_extent)
TypeError: RegisterWithGeodatabase() takes at most 1 argument (6 given)

Outcomes