One Star

How to generate a sequence with a tMap

Hi everybody,
I read a lot of topic on this subject but I didn't suceed in what I wanted to do.
My goal is to generate a sequence for a delimited file.
For example, I have :
id_connexion, id_utilisateur, date_connexion,....
My delimited file is composed like this :
pierre;17/06/2008 11:11:15
jacques;17/06/2008 11:12:15
I'd like to generate a sequence to fill in the field id_connexion, this is what i'd like to have :
1;pierre;17/06/2008 11:11:15
2;jacques;17/06/2008 11:12:15
But not for a new delimited file but for a tOracleOutput. I've tried a lot of things, but I didn't find how to do.
My project is in java.
I have tOracleInput->tMap->tOracleOutput.
Could you please help me.
Thanks in advance.
19 REPLIES
One Star

Re: How to generate a sequence with a tMap

Hello,
Create a variable in the Tmap with the folowing expression
Numeric.sequence("s1",1,1)
And link this variable to a new out column
JC
One Star

Re: How to generate a sequence with a tMap

I've already tried it but I have this message :
Starting job Int_Alim_Connexion at 11:54 17/06/2008.
null
null
null
Job Int_Alim_Connexion ended at 11:54 17/06/2008.
Do you know what could I do?
One Star

Re: How to generate a sequence with a tMap

I've tried, it works good.
Sent an image of your Tmap
One Star

Re: How to generate a sequence with a tMap

cool username!
One Star

Re: How to generate a sequence with a tMap

One Star

Re: How to generate a sequence with a tMap

How do you put a picture in the forum please?
One Star

Re: How to generate a sequence with a tMap

you have to be registered and logged in.
One Star

Re: How to generate a sequence with a tMap

I don't succeed to put the picture, so could you please tell step by step how do you do to create the sequence and where do you put it.
Thanks in advance.
One Star

Re: How to generate a sequence with a tMap

Here is sample tMap with Sequence Generator
One Star

Re: How to generate a sequence with a tMap

Thanks for your mapping but I don't understand why do you have 2 primary keys.
In my mapping, I have my delimited file on the left, my sequence in the "var" part (on the middle), and on the right side, my destination table. My sequence is link to the primary key of my destination table.
I still have an error, he doesn't want to raise my sequence because he always returns "null".
Do you have an idea please?
I use a FileDelimited->tMap->tOracleOutput and not tOracleInput->tMap->tOracleoutput like I said. I was wrong, sorry.
Thanks in advance for your answer.
One Star

Re: How to generate a sequence with a tMap

In the Ecosystem, I saw a tAddSequence component -
One Star

Re: How to generate a sequence with a tMap

Hi Megadeth2,
I just modified the existing job to show the sequence. We do not need to have two primary keys. Its an example.
-
sangi
One Star

Re: How to generate a sequence with a tMap

Hi Megadeth2,
I just designed the job for sequence generator.
Here I am attaching the job and tMap.
This is my tsv file:
Organization City
Yahoo CA
Google NY
AOL NJ
Database MySQL:
1,Yahoo,CA
2,Google,NY
3,AOL,NJ

Var Expression:
Numeric.sequence("s1",1,1)

please upload images of your job if you still face any problem.
regards,
sangi
One Star

Re: How to generate a sequence with a tMap

Hi Sangui,
Thanks for your answer, I did the same you show me but I still have the problem "null", I don't understand why he doesn't want to raise my sequence.
I can't upload images, so I'll keep on searching what is the problem.
Thanks a lot for yours advices.
One Star

Re: How to generate a sequence with a tMap

I think it's a problem with my destination table because I do the same thing with an other job and it's ok.
One Star

Re: How to generate a sequence with a tMap

are you able to generate the sequence?
One Star

Re: How to generate a sequence with a tMap

My problem was my destination table because I did the same thing with an other job and it was ok. Now it's ok.
Thanks a lot for your help.
One Star

Re: How to generate a sequence with a tMap

Hi all,can any body explain how to generate cyclic sequence values in talend bigdata.
EX
col1 col2
A 1
A 2
A 3
B 2
B 2
One Star

Re: How to generate a sequence with a tMap

Hi all,can any body explain how to generate cyclic sequence values in talend bigdata.
EX
col1 col2
A 1
A 2
A 3
B 1
B 2