Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

autoIncrement of oracle sequence with talend

I have a quastion can i generate the next value of an oracle sequence ,  to insert into a primary key of a table ,with talend in the composant troaclerow , or what should i do 

thanks for help 
Labels (2)
23 Replies
Anonymous
Not applicable
Author

Yes you can. Simply do not set the value of the primary key field NOT in the schema - also remove it from the schema what probably cause the schema to be build-in, instead use the advanced settings of the tOracleOutput and set here an additional field (your primary key field) and set as sql expression "your_sequence.nextval".
Anonymous
Not applicable
Author

Thanks Jlolling for your reply
i willl try this, juste a question can i change format date of TalendDate.getCurrentDate(); to this format dd/mm/yyyy HH:mi:ss
Thanks,
Anonymous
Not applicable
Author

Thementioned function returns a Date object. A pattern is only needed if a Data have to be converted from or to a textual representation.
Anonymous
Not applicable
Author

Thanks jlolling for your help ,
It works Thanks,
just a question, can i generate the sequence with toraclerow ?
or it should be a toracleoutput and my user oracle should have a privilége to select the sequence 
Thanks for your help,
Anonymous
Not applicable
Author

Only the row components can execute such statements like create sequence...
Anonymous
Not applicable
Author

I have my sequence that autoincrement my primary key of the table, 
juste question how to do in the toraclerow that generate the next value of my sequence ?
Anonymous
Not applicable
Author

hi,
i have in the table other column i juste want to auto increment the primary key 
I create a sequence with name : kpi.id_seq_http_trace;
when I try this query in toraclerow :
"INSERT INTO  KPI.HTTP_TRACE(ID_HTTP_TRACE)
 values ("   kpi.id_seq_http_trace.NEXTVAL    
+")"
it does'nt work 
and when i try with these components: it does'nt work also :
tfixedFlowInput---tmap---toracleoutput 
and ithe advancedSettings of toracleoutput I met 
the name: "seq_value"
SQL expression: "KPI.ID_SEQ_HTTP_TRACE.NEXTVAL"
Position : Before
and finally the reference column : id_http_trace
but it does'nt work because i have an error 
Thanks for your great help 
Anonymous
Not applicable
Author

To create a sequence is only necessary once and not all the time a job runs. Thats because I usually do this in separate SQL scripts which creates the tables and all the database objects needed.
You have obviously misunderstood me. You do not need to use a explicit insert statement in the tOracleRow component. To insert a key based on the sequence it is quite enough what I told you for the tOracleOuput component - I though you got it.
You question was "generate a sequence" and I probably misunderstood you: generate a new value of the sequence is done with the method nextval of the sequence, nothing else is necessary. 
Every time you call my_sequence.nextval the sequence generates a new value.
If you want create (not generate) a sequence, do it once in a SQL script.
Anonymous
Not applicable
Author

This is my screen shot : i make a job with these component 
but it does'nt work 
can you explain to me how to generate a next val of a sequence in the toracleoutpout and in the toraclerow 

0683p000009MEnN.jpg 
Thanks,