• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Using tOracleSP output to create a job running conditions

#1 2012-05-16 20:13:06

tiagoamoreira
Member
Registered: 2011-05-05
Posts: 10

Using tOracleSP output to create a job running conditions

Tags: [oracle]

Hello,

I have to validate with a SP if a job can run. I create my simple job something like this toracleInput -> tmap -> Output.
Inside the same job i put put a tFixedFlowInput (with input parameters for SP) -> tOracleSP (with 2 output columns) and know I want to make a condition using this 2 columns to validate if my starting job can run.

tFixedFlowInput -> tOracleSP --IF --> tOracleInput -> tmap -> Output

I tried to use Run IF but I can't access tOracleSP output columns. Any ideas to resolve this?



I tried something else to:
tFixedFlowInput -> tOracleSP -> tMap (with the 2 output columns condition) -> tLogRow --IF-->  tOracleInput -> tmap -> Output

The IF conditions is works fine and it's something like ((Integer)globalMap.get("tLogRow_1_NB_LINE"))>0.

I think this solution is not "very smart"...but I don't know a better way to do it.


Finally one of my requisites it's use the 2 output columns from the tOracleSP during the initial Job : toracleInput -> tmap -> Output and with my workaround I can't do it.

Offline

#2 2012-05-17 08:17:59

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

Re: Using tOracleSP output to create a job running conditions

Hi

Have you gotten the correct output from tOracleSP? Can you see them with tLogRow?

If so, I think you can link tOracleSP with tJavaRow and save output values into two context variables.

Regards,
Pedro


Only Paranoid Survive.

Offline

#3 2012-05-17 10:41:15

tiagoamoreira
Member
Registered: 2011-05-05
Posts: 10

Re: Using tOracleSP output to create a job running conditions

Hello,

Yes I can see the Output in tLogRow. How can I use tJavaRow to assign variables?

I tried to create new variables in my context but I can't see them in my job. I only find the connection variables from the context.

I tried a simple test with an existing variable success:
tJavaRow:   context.myDB_AdditionalParams  = input_row.myFirstValue
Run IF condition:    context.myDB_AdditionalParams == "value"


What I'm doing wrong? Why context in the job it's updated with the new Variables?  I notice that my job use a context with 2 groups DEV and PROD and I only saw the Default (DEV).


If I use this variable in 2 jobs running at the same time I need more variables? They are local to the job or Global?


Rergards.

Offline

#4 2012-05-17 10:43:52

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

Re: Using tOracleSP output to create a job running conditions

Hi

The expression of RUN-IF is wrong.

Code:

ccontext.myDB_AdditionalParams.equals("value")

Besides, you'd better add context variable as the following image.

Regards,
Pedro


Uploaded Images


Only Paranoid Survive.

Offline

#5 2012-05-17 14:29:37

tiagoamoreira
Member
Registered: 2011-05-05
Posts: 10

Re: Using tOracleSP output to create a job running conditions

Thank you Pedro. It's working!

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Using tOracleSP output to create a job running conditions

Board footer

Powered by FluxBB