write a insert query using a tMysqlRow component?

One Star

write a insert query using a tMysqlRow component?

Query: insert into employee values(name,id) on duplicate key update id=id+1
Job structure: 2 tmysqlInputs to a tMap , leading to a tMysqlRow component
What should be the format of the sql query.
One Star

Re: write a insert query using a tMysqlRow component?

any help here?
One Star

Re: write a insert query using a tMysqlRow component?

Let's say that the output from your tMap is call "out" and it has two fields/columns- one called v1 (for name column) and one called v2 (for id). The Query in your tMySQL would be:
"insert into employee values("+out.v1+","+out.v2+") on duplicate key update id=id+1"

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog