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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Set a SQL result as a global var

Hi everyone,
I would like to get the result of a SQL query (it is a sequence number), and set it as a global variable I could use in several child jobs.
How can I do that (under TOS 3.0.x) ?
Thank you in advance.
Best regards,
Nicolas
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello
In father job, generate the unique number and set it to a global or context var. on tRunjob, pass the value of global or context var to a context var defined in child job.
In child job, define a context var which will be used to receive value on father job.
Best regards
shong

View solution in original post

7 Replies
_AnonymousUser
Specialist III
Specialist III

Hi,
I do this task by using a tContextLoad componet on exit on tMap component.
Anonymous
Not applicable
Author

Hello Nicolas
Do you want to pass a parameter dynamically to child job or pass a fixed one?
I would like to get the result of a SQL query (it is a sequence number)

Please give an example to explain this sentence
Best regardsg
shong
Anonymous
Not applicable
Author

Hi,
In fact, I want to generate one unique number number each time I launch a job.
It is an occurence generated by a sequence : etl_seq_int_occurence_id.NEXTVAL.
It's useful for some logs.
I would like to keep this value in a global (or context) var.
I will pass this variable in context parameter to some child jobs.
Regards,

Nicolas
Anonymous
Not applicable
Author

Hello
In father job, generate the unique number and set it to a global or context var. on tRunjob, pass the value of global or context var to a context var defined in child job.
In child job, define a context var which will be used to receive value on father job.
Best regards
shong
Anonymous
Not applicable
Author

Hi Shong,
Thank you.
However, I don't know how to pass my SQL result to a global or context var.
I tried to link an "tOracleInput" to a "tSetGlobalVar" component, but I haven't found how to set the input data as a var, and I haven't found any global var to take my SQL query result.
Best regards,
Nicolas
Anonymous
Not applicable
Author

Hello
However, I don't know how to pass my SQL result to a global or context var.

tOracleInput-->tJavaRow(globalMap.put("sequence", input_row.colName)
Best regards

shong
Anonymous
Not applicable
Author

Hi again,
Ok, I'm going to try it.
Thank you much Shong.
Best regards,
Nicolas