Assigning Values to Context Varibales for Incremental Data load

One Star

Assigning Values to Context Varibales for Incremental Data load

Hi,
I am new to Talend and was looking for the way, we can do incremental data load. I am using Oracle database for Source and Target. I have create Context variable with name ‘PERIOD_YEAR’ which hold year data in ‘Integer’ Data Type.
Problem Description: I am using below objects in my Job. 
[size=3]tOracleInput: To get the Max Date which get loaded into the target table using SQL[/size]
                         Select MAX(PERIOD_YEAR) from <TARGET_TABLE>
[size=3]tJavaRow: Is used to assign values to Context variable which we got from the above object ‘tOracleInput’  [/size]
[size=3]                    context.PERIOD_YEAR = input_row.PERIOD_YEAR;[/size]
Then I have remaining Objects which fetch incremental data bases on my Context Variable.
I am Getting Error at ‘tJavaRow’ step with message like ‘Type mismatch: cannot convert from BigDecimal to Integer’.
Any pointer will appreciated, Thanks for your help and support.
Regards
Saket Krishna



 

Community Manager

Re: Assigning Values to Context Varibales for Incremental Data load

What is the data type of PERIOD_YEAR column on the schema of tOracleInput? Is it BigDecimal? Try to change it to Integer type. 
----------------------------------------------------------
Talend | Data Agility for Modern Business

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog