开发者

Talend increment counter

开发者 https://www.devze.com 2023-02-14 16:22 出处:网络
I\'m making a ETL in Talend that add data in a table. The table is for a old system 开发者_如何学JAVAand the primary key is not auto-incremental.

I'm making a ETL in Talend that add data in a table.

The table is for a old system 开发者_如何学JAVAand the primary key is not auto-incremental. So I have to get the maximum id plus one every time that I insert a value in the table.

I'm trying to use a var in the Expression Builder:

  • first I save the max and set in a context variable
  • then in the Expression Builder:

    Context.Max += 1
    

The problem is that every time I get the same id, I need to save the sum.


Finally I found what was looking for:

Numeric.sequence("var2", Context.Max, 1) 

This increment by 1 the Context.Max and save it in "var2".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号