Skip to main content

I am trying to write a bunch of shape files to a geopackage but am getting a strange error.

 

'OGCGEOPACKAGE writer: sqlite3_exec(CREATE TABLE "table_name" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL'

 

There seems to be a problem when the writer constructs the primary keys for the database, but I have no idea how to address this.

 

There is no id attribute in the source data, I actually tried adding one and the writer handled this by changing the name of the primary key to id_0. Still got the same error though.

 

I am using fme_feature_type to set the table names and schemas.

Hi @aron​, Are you using a Writer with dynamic settings your shape files? Would you be able to share your reader and writer parameters?


Use AttributeExposer to expose the id attribute followed by AttributeRemover to remove it.

Shape files have a baked in id attribute and you have to get rid of it to write to another database file format.


Use AttributeExposer to expose the id attribute followed by AttributeRemover to remove it.

Shape files have a baked in id attribute and you have to get rid of it to write to another database file format.

Thanks!

 

I tried exposing (and deleting) 'multi_reader_full_id' and 'multi_reader_id' but that did not work. What is the name of the ID attribute?


Thanks!

 

I tried exposing (and deleting) 'multi_reader_full_id' and 'multi_reader_id' but that did not work. What is the name of the ID attribute?

Try "id" lowercase, simple. Don't look for it, just type it in manually.

You have to brute force it


Using the recent fme 2022.2 doesn't allow to update or delete an existing geopackage when the original input(s)' primary keys were exposed and deleted.

 

Depending on my input feature, the primarykey to update is alternatively named 'id' or 'fid'.

 

The error message is:

OGCGEOPACKAGE writer: OGCGEOPACKAGE writer: For feature type 'table1', existing primary key is named 'id' but no attribute was found on schema with that name. Updates and deletes must use the existing primary key

 

Alternatively, I could consider renaming both potential primary key names to a single one. How could this be done?


Reply