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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Using results from a Database select statement in multiple Jobs

I have set up Talend with an Oracle database.
I will then run a select against a table it comes back with the key "transaction_ID" and then value "global_tran_id"
I want to take what is inside the value key number and place it into a variable so that I can use it in another job.
However, it doesn't seem to want to do this.
How can create this so that I can use it in multiple select statements.
What I am referring to is that once I have the global tran number I want to use that number in several selects which are in
different jobs. How can I do that?
Thanks
Killoran
Labels (3)
22 Replies
Anonymous
Not applicable
Author

I had been using a tOracleInput.
with the following sql statement: SELECT * FROM table1 WHERE TRANSACTION_iD = '192890'
Ist the tJavaRow the code I have:
//Code generated according to input schema and output schema
output_row.TRANSACTION_ID = input_row.TRANSACTION_ID;
output_row.GLOBAL_TRAN_ID = input_row.GLOBAL_TRAN_ID;
context.GLOBAL_TRAN_ID = input_row.GLOBAL_TRAN_ID;
System.out.println(context.GLOBAL_TRAN_ID);
Followed by the tLogRow
Is there a different way with the tOracleOutput?
I am not familiar with a way where I can attach select statments to tOracleOutput?
One other point. The problem first is getting the first job to print the context.GLOBAL_TRAN_ID variable.value in the
proper place before moving on to the second and third job.
Right now I am not even seeing the global value in the first job.
Thanks
Anonymous
Not applicable
Author

hi
I think the context value is printing properly
as you can see after the connected , the context value is printed (52473), so there should not be any problem there.
connecting to socket on port 3558
connected
52473
.--------------+--------------.
| tLogRow_1 |
|=-------------+-------------neutral
|TRANSACTION_ID|GLOBAL_TRAN_ID|
|=-------------+-------------neutral
|192890 |52473 |
'--------------+--------------'
disconnected
Job Global_Transaction_ID ended at 16:05 22/08/2010.

hope its correct
Anonymous
Not applicable
Author

It is printing it to the results screen after you run the job however, it is not printing it inside the context variable.
When I look at the screen it shows
Name Value
GLOBAL_TRAN_ID 0
So although it is showing the information in the results window it is not moving the information
into the actual variable.
I need this information in the actual context variable so that I can use it in other jobs.
Eventually I will be taking it to a level where I will us this value in 10 or 20 jobs. But above all else
I need to see it in the first so before moving on to the next job. Hope this makes
some sense.
Here is something else I have tried. I switched out my tlog_row with a tContextLoad
I set the operation up to print out all the operation and error if a variable in context but not loaded.
This is the response I got.
Starting job Global_Trans_ID_01 at 13:26 25/08/2010.
connecting to socket on port 3535
connected
tContextLoad_1 set key "192890" with value "52473"
Error: Parameter "GLOBAL_TRAN_ID" has not been set by tContextLoad_1
disconnected
Job Global_Trans_ID_01 ended at 13:26 25/08/2010.
So the 52473 number is not being loaded into the context variable.
Any ideas?
Largent