Question

rowid in sqlite writers

  • 1 March 2024
  • 2 replies
  • 26 views

Userlevel 1
Badge +11

Hi all

I need support please

 

I’m not expert in sqlite db and I understood that there is a column called rowid 

I create a sqlite db but when I open this db in sqlreader I see that the values present in the rowid column start from 1 my reques is I need that the values present in the rowid colums must be equal to the values present in the Id column.

 

thx for support

 

 


2 replies

Badge +4

Hi @checcosisani, thank you for your question! Sounds like you could benefit from the AttributeManager transformer to update the column to match rowid to the values present in Id: https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Transformers/Transformers/attributemanager.htm

Userlevel 5
Badge +36

** Untested **

According to the SQLite documentation "Rowid values may be modified using an UPDATE statement in the same way as any other column value can".

In your SQLite writer you can add SQL code to run after the writing has finished, in "SQL to Run After Write” (under “Advanced"). Here you can enter the SQL code needed to give each rowid field the value of your column Id, something like

Update YOUR_TABLE_NAME_HERE set rowid = Id

Reply