• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] Set a SQL result as a global var

#1 2009-06-08 15:05:27

nSmolyniec
Member
Company: Soft Solutions
Registered: 2009-03-23
Posts: 91

[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

Last edited by nSmolyniec (2009-06-09 10:47:24)


T.O.S. Version : 3.0.4
Generated language : Java
O.S. : Win XP SP3

Offline

#2 2009-06-08 16:10:38

Phil34
Guest

Re: [resolved] Set a SQL result as a global var

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

#3 2009-06-08 16:21:47

shong
Talend team
Registered: 2007-08-29
Posts: 10289
Website

Re: [resolved] Set a SQL result as a global var

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


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#4 2009-06-08 16:52:18

nSmolyniec
Member
Company: Soft Solutions
Registered: 2009-03-23
Posts: 91

Re: [resolved] Set a SQL result as a global var

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

Last edited by nSmolyniec (2009-06-08 16:52:32)


T.O.S. Version : 3.0.4
Generated language : Java
O.S. : Win XP SP3

Offline

#5 2009-06-09 04:18:25

shong
Talend team
Registered: 2007-08-29
Posts: 10289
Website

Re: [resolved] Set a SQL result as a global var

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


Uploaded Images


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#6 2009-06-09 10:07:46

nSmolyniec
Member
Company: Soft Solutions
Registered: 2009-03-23
Posts: 91

Re: [resolved] Set a SQL result as a global var

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


T.O.S. Version : 3.0.4
Generated language : Java
O.S. : Win XP SP3

Offline

#7 2009-06-09 10:20:24

shong
Talend team
Registered: 2007-08-29
Posts: 10289
Website

Re: [resolved] Set a SQL result as a global var

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


Email:shong@talend.com
Choose Talend, Enjoy Talend!
New & Event: Talend Help Center
Talend-->the leader of open source data management and application integration solutions!

Offline

#8 2009-06-09 10:46:31

nSmolyniec
Member
Company: Soft Solutions
Registered: 2009-03-23
Posts: 91

Re: [resolved] Set a SQL result as a global var

Hi again,

Ok, I'm going to try it.
Thank you much Shong.

Best regards,

Nicolas


T.O.S. Version : 3.0.4
Generated language : Java
O.S. : Win XP SP3

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » [resolved] Set a SQL result as a global var

Board footer

Powered by FluxBB