DEFINE_SDB_CONNECTION
The DEFINE_SDB_CONNECTION allows the user to define a connection and use that definition in the script. This is required for enterprise spatial databases that require a defined connection, but is not needed for exporting to a file-based spatial database such as Esri Personal Geodatabase or Spatialite/SQLite.
Using the SAVE_CONNECTION parameter will cause this definintion to be stored with the connections defined using the Connection Manager.
- SDB_CONNECTION_NAME - The name of the connection. This is used to identify the connection in a subsequent EXPORT_VECTOR or IMPORT_SPATIAL_DB command.
- TYPE - Spatial DB Type Name, one of:
- ESRI_ARCSDE - Esri ArcSDE Geodatabase
- MSSQLSERVER - Micorsoft SQL Server Spatial
- MYSQL - MySQL Spatial
- ORACLE - Oracle Spatial Database
- POSTGIS - PostGIS/PostgreSQL
- SDB_SERVER - the server where the database is located.
- SDB_PORT - the required server port number. In an ArcSDE geodatabase connection, this is also known as the Service parameter.
- SDB_DATABASE_NAME - The database name. This is optional when defining an Esri ArcSDE geodatabase connection. Whether or not it is needed depends on your particular installation.
- SDB_USER_NAME - The user name that will be used to access the database
- SDB_PASSWORD - The password in plain text
- SDB_SAVE_USER_AND_PASSWORD - If the SAVE_CONNECTION=YES parameter is used, this indicates whether or not to save the user name and password with the connection definition.
- SDB_USE_OS_AUTH - Use current OS login credentials to connect to the database. Specify SDB_USE_OS_AUTH instead of a user name and password. Supported only for Microsoft SQL Server and Oracle Spatial Database connections.
- SAVE_CONNECTION - Boolean value that indicates whether or not this definition should be saved in the registry (if it does not already exist). If value is NO, then this definition will only be used in this script. Default is NO.
- OVERWRITE_EXISTING - Boolean value that indicates whether or not the definition in the script should replace the existing definition. Default will be NO.
SAMPLE
DEFINE_SDB_CONNECTION TYPE="POSTGIS" SDB_CONNECTION_NAME="PostGIS" \ SDB_SERVER="myserver" SDB_PORT="5432" SDB_DATABASE_NAME="mydb" \ SDB_SAVE_USER_AND_PASSWORD="YES" SDB_USER_NAME="pguser" \ SDB_PASSWORD="pgpassword" SAVE_CONNECTION=YES