I want to iterate Numeric.Sequence(s1,1,1) every time i launch the job

Seven Stars

I want to iterate Numeric.Sequence(s1,1,1) every time i launch the job

I use Numeric.sequence("s1",1,1) as an autoincrement ID within one launch (so each row +1), but i want an auto-incremented ID for each time i launch the whole job (for the same job ID: 1 - the next time i launch the job ID: 2 a.s.o &&  ID is stored at Database). Any Solution for this???


Accepted Solutions
Forteen Stars

Re: I want to iterate Numeric.Sequence(s1,1,1) every time i launch the job

@meetmahajan,i suggest you read the Id and store in memory using tSetGlobalvar or tJava you can use globalmap.put and then in the next flow read the that globalmap value using (integer) type in Numeric.Sequence.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

All Replies
Forteen Stars

Re: I want to iterate Numeric.Sequence(s1,1,1) every time i launch the job

@meetmahajan,i suggest you read the Id and store in memory using tSetGlobalvar or tJava you can use globalmap.put and then in the next flow read the that globalmap value using (integer) type in Numeric.Sequence.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Forteen Stars

Re: I want to iterate Numeric.Sequence(s1,1,1) every time i launch the job

it will not work as requested - between Job executions, because memory released when Job finished

solution is in a question - store value in Database

in sequence

s1 - it is name, could be any like "ExecutionNumber"
1 - start value, could be any

2 - incremental step, could be any

 

so, if at the end of Job save Current value of sequence ExecutionNumber in Database (or csv file)
and on begin of Job check this value and use as start value for sequence, all would work

-----------

2019 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch