I would like to develop an ArcGIS Pro AddOn that uses the same SqLite Database as another product of my company. For the tables in the Database, the OBJECTID / OID field is missing.
What are the requirements from the perspective of the SQLite Database to fullfill the ArcGIS Pro requirements ? How can I create such a field in SqLite ?
Solved! Go to Solution.
I think I found what I need by opening a feature Class created (or in my case copied) by ArcGIS Pro and then opening the file in DB Browser for sqlite. There, it is possible to see the create statement for the table.
CREATE TABLE [Schacht] (OBJECTID integer primary key autoincrement not null, ....
So the OBJECTID must be
integer
primary key
autoincrement
not null
You can look here:
and here:
For some input. It appears that not all versions supported tables to start out with, so make sure you're using a release that supports it.
I don't find there what I am looking for. If I create a column in a table by
ALTER TABLE table_name
ADD new_column_name column_definition;
where new_column_name = 'OBJECTID', what do I need to take as column_definition in order to get an OBJECTID column that will be working with ArcGIS Pro ?
That will not work. You have to create a geodatabase first, which will in essence create stored procedures and functions that aid in creating feature classes and tables in that database. The instructions on how to create a geodatabase are in the links in my reply above, specifically: Create SQLite Database (Data Management)—ArcGIS Pro | Documentation
Once you follow these instructions you should then be able to create a feature class (point/lines/polygons) and/or tables by using the right click on the database. Once created, you can also add the database to your project to make access easier.
I think I found what I need by opening a feature Class created (or in my case copied) by ArcGIS Pro and then opening the file in DB Browser for sqlite. There, it is possible to see the create statement for the table.
CREATE TABLE [Schacht] (OBJECTID integer primary key autoincrement not null, ....
So the OBJECTID must be
integer
primary key
autoincrement
not null