Skip to main content
Question

rowid in sqlite writers


checcosisani
Contributor
Forum|alt.badge.img+12

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

edgarbaculi
Safer
Forum|alt.badge.img+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


geomancer
Evangelist
Forum|alt.badge.img+46
  • Evangelist
  • March 4, 2024

** 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


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