August 15, 2023

Scenario: Updating SQLite rows – Docs for ESB 6.x

Scenario: Updating SQLite rows

This scenario describes a job which updates an SQLite database file based on a
prepared statement and using a delimited file.

Use_Case_tSQLiteRow1.png
  • Drop a tFileInputDelimited and a tSQLiteRow component from the Palette to the design workspace.

  • On the tFileInputDelimited
    Basic settings panel, browse to the input file
    that will be used to update rows in the database.

Use_Case_tSQLiteRow2.png
  • There is no Header nor Footer. The Row separator is a
    carriage return and the Field separator is a
    semi-colon.

  • Click the […] button next to Edit schema and define the schema structure in case it is not stored in the Repository.

Use_Case_tSQLiteRow3.png
  • Make sure the length and type are respectively correct and large enough to
    define the columns.

  • Then in the tSQLiteRow
    Basic settings panel, set the Database filepath to the file to be updated.

Use_Case_tSQLiteRow3_.png
  • The schema is read-only as it is required to match the input schema.

  • Type in the query or retrieve it from the
    Repository
    . In this use case, we updated the
    type_os for the id defined in the
    Input flow. The statement is as follows: "Update download set type_os=?
    where id=?"
    .

  • Then select the Use PreparedStatement check
    box to display the placeholders’ parameter table.

Use_Case_tSQLiteRow4.png
  • In the Input parameters table, add as many lines as necessary to cover all
    placeholders. In this scenario, type_os and
    id are to be defined.

  • Set the Commit every field.

  • Save the job and press F6 to run it.

The download table from the SQLite database is thus updated with
new type_os code according to the delimited input file.


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x