[resolved] Inserting row number dynamically

Seven Stars

[resolved] Inserting row number dynamically

Hi,
I have an XML file from which I extract the fields using tXMLMap component.
Along with these field values I have to insert a row number for each row inserted.
Any idea how this can be done?

Accepted Solutions
One Star

Re: [resolved] Inserting row number dynamically

Ketan,
You can use Numeric.sequence expression in your tMap to increment a variable.
For exemple : Numeric.sequence("var1",1,1)
The second "1" is the starting number, the last "1" is to increment by 1, and the new value is saved into "var1".
Devy

All Replies
Four Stars

Re: [resolved] Inserting row number dynamically

How about using function for generating sequence ?
Vaibhav
Seven Stars

Re: [resolved] Inserting row number dynamically

How about using function for generating sequence ?
Vaibhav

Do you mean I should create an SQL function for this? Is it not possible through Talend?
One Star

Re: [resolved] Inserting row number dynamically

Ketan,
You can use Numeric.sequence expression in your tMap to increment a variable.
For exemple : Numeric.sequence("var1",1,1)
The second "1" is the starting number, the last "1" is to increment by 1, and the new value is saved into "var1".
Devy