Before you can use ST_Geometry functions from a SQL client to access spatial data in a mobile geodatabase, you must load the Esri ST_Geometry extension.
Follow these steps to enable the ST_Geometry extension in a mobile geodatabase:
- Download the ArcGIS AllSource ST_Geometry Libraries (SQLite) .zip file from My Esri and unzip it.
- Place the ST_Geometry file in a location that is accessible to the mobile geodatabase and the
SQL editor from which you will load the extension.
If your mobile geodatabase is on a Microsoft Windows machine, use the stgeometry_sqlite.dll file. If your mobile geodatabase is on a Linux machine, use the libstgeometry_sqlite file.
- From the SQL client, connect to the SQLite database where the mobile geodatabase is stored.
- Load the ST_Geometry library.
This example loads the ST_Geometry library to an SQLite database on a Microsoft Windows computer:
SELECT load_extension('stgeometry_sqlite.dll','SDE_SQL_funcs_init');
This example loads the ST_Geometry library to an SQLite database on a Linux computer:
SELECT load_extension('libstgeometry_sqlite','SDE_SQL_funcs_init');
- Call the CreateOGCTables function to add ST_Geometry tables to the database.
SELECT CreateOGCTables();
You can now use ST_Geometry functions in SQL statements carried out from a SQL client to access spatial data in a mobile geodatabase. For more information, see the ST_Geometry SQL function reference.