• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Problem whith context variable

#1 2012-06-07 11:12:22

boroa
New member
Registered: 2012-06-07
Posts: 4

Problem whith context variable

Hi,

I have the following question:

In my Talend job,the tJavaRow_1 component stores value in a context variable. This context variable is used for build the query in MysqlInput_3 but, when the query is executed, the value of context variable has not yet been assigned. How I can solve this?

Thanks
                                                                                                                                    [MysqlInput_3]
                                                                                                                                              |
                                                                                                                                              V
[MysqlInput_1] --> [tJavaRow_1] --> [tFlowToIterate] --> [MsqlInput_2] -->  [tJavaRow_2] --> [tMap] --> [MysqlOutput]

Query in MysqlInput_3:

SELECT columns
FROM tables
where column = '"+context.variable+"'

Last edited by boroa (2012-06-07 11:13:48)

Offline

#2 2012-06-07 11:21:34

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: Problem whith context variable

Hi

Welcome to Talend Community!

Could you show us the error log?
Change it as seen below.
                                                                                                                       [MysqlInput_2]
                                                                                                                                 |
                                                                                                                                V
                                                                                                                            tJavaRow
                                                                                                                                 |
                                                                                                                                V
                                                                     
[MysqlInput_1] --> [tJavaRow_1] --> [tFlowToIterate] --> [MsqlInput_3] --> [tMap] --> [MysqlOutput]

Regards,
Pedro


Only Paranoid Survive.

Offline

#3 2012-06-07 11:39:16

boroa
New member
Registered: 2012-06-07
Posts: 4

Re: Problem whith context variable

Thanks Pedro!

There is no error message (log is OK), the only problem is that the query is executed without the value of context variable (is executed before the asignation in tJavaRow_1 )

Offline

#4 2012-06-07 11:40:56

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: Problem whith context variable

Hi

Try to exchange the locations of MysqlInput2 and MysqlInput3.
Wait for your feedback...

Regards,
Pedro


Only Paranoid Survive.

Offline

#5 2012-06-07 11:48:13

boroa
New member
Registered: 2012-06-07
Posts: 4

Re: Problem whith context variable

Thanks for your answer Pedro, but MysqlInput2 also uses the same context variable to build his query.

Offline

#6 2012-06-07 11:54:01

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: Problem whith context variable

Hi

The workaround is to use tRunjob for tMysqlInput2 and tMysqlInput3.
Pass the context variables from father job into child job.

Regards,
Pedro


Only Paranoid Survive.

Offline

#7 2012-06-08 18:21:39

boroa
New member
Registered: 2012-06-07
Posts: 4

Re: Problem whith context variable

Thanks Pedro, I'll try this way.

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Problem whith context variable

Board footer

Powered by FluxBB