Skip to main content
Question

Create a primary integer autoincrement key in sqlite


kimo
Contributor
Forum|alt.badge.img+10
  • Contributor

I can set an index on an integer or even a unique index, but there is no type for a primary key or autoincrement. How can I specify this? I could do this with an SQL Create expression. Can I use SQL to create a schema?

I am adding a changeset with new records using insert but I need an OID column for ArcGIS to be able to use the table/featureclass separate from the real ID.

2 replies

kimo
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • May 10, 2023

My workaround is to post process use the 'SQL to Run After Write' :

UPDATE changeset SET OID = rowid where OID is NULL

Not quite a proper autoincrement, but it gets around the current roadblock.


nielsgerrits
VIP
Forum|alt.badge.img+54

I think this can be dine in the User Attributes tab in the (Feature)Writer. Set type to integer and Index to Unique.

2023-05-10_13h07_22


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings