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

Announcements
Streamlining user types in Qlik Cloud capacity-based subscriptions: Read the Details
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

Retrieving the last generated Sequence ID ....

Helllo,
I use Oracle sequence as Primary Key to insert data in Oracle table in my job...
In a subjob, I need to retrieve these data I just inserted in the parent job. To do that, I need to retrieve the generated sequence ID; How can I do that ?
Currently, I implemented a "workaround" query (see below).. But, doing this so, I have no guarantee to retrieve the good one (e.g. if several of the jobs are running at the same time, or DB used by others programs).
"select * from V2_OPERATIONS
where FK_FILEID = ( select Last_Number-1 from user_sequences where sequence_name = 'V2_FILEID' )
"
Using Oracle, we could use INSERT into ... values .... returning LAST_SEQ_ID . But how to implement such a thing in Talend ?
I would be happy to get our suggestions !
Thanks,
François,
Labels (2)
2 Replies
Anonymous
Not applicable

Hi
Please see a related topic:
https://community.talend.com/t5/Design-and-Development/resolved-Store-value-of-Oracle-Sequence-for-u...
Let me know if you still have trouble.
Shong
Anonymous
Not applicable

Hi,
I read the case 8824... But, I think the problem remains for me.
My biggest problem is not to retrieve the last sequence number itself.... The problem is that I want to be sure that I get mine... because the table into which I insert data is not only used by Talend. Others programs (home made tools) can also do "INSERT' in this table during Talend job processing... And, in that case, I'm not sure to retrieve the sequence number that I used during the INSERT that happened during Talend job processing. That the reason I asked a way to retrieve to value returned by the Oracle statement INSERT into ... values ... RETURNING MY_SEQUENCE
Thanks,
François,