I have a requirement where there is a csv file as input for example consider its having 1000 records
with the below schema
I have to load the data into a oracle table but only specific records within a range
(ex : 200 to 350,500 to 875,etc) I need to give the range at run time using context variables.
how can I achieve that?
does tFileRowCount supports that or is there any solution??
quick reply would be appreciated
Solved! Go to Solution.
Thanks for the reply.
I had a look at tSampleRow component but in this we have to hard code the values which i don't want to.
But my requirement is I need to specify the range dynamically when the job runs.
Today I have a req to load records between 300 to 400 .
tomorrow the req can be to load between 600 to 900,etc like this.
So how can I achieve this??
Please find attached screenshot of my job. I tried using context variables prompting them at run time for the range values. still its not giving the output
Please if any one knows let me know where I'm doing wrong?
I tried to display the values of context variables and they are getting displayed on the console but none of the rows are moving to tlogrow from tsamplerow
may the better is to have a single context variable like context.Interval so you can define the desired interval as you want such as:
I tried as you told like keeping the expression
context.from+".."+context.to in tSampleRow and I got the above error.
PFA screenshot for the error.
both the context variables are of type Integer.
Please let me know for any details.
Sorry It didn't work.
tJavaRow code : context.interval = new String(context.from+".."+context.to);
tSampleRow code : context.interval
All the 3 variables are of type String
But still it didn't resolve my issue.
Thanks for your patience. it worked.
But my question is why it didn't work if we do in other way like
context.interval = context.from+".."+context.to; ----> in tJavaRow
and use the
context.interval -----> in tSampleRow ???
The variable used as Range must be set before the subjob including the tSampleRow starts.
So, if you have a tJava before this subjob, it works too:
If it is on number range suppose source field of type double divided by lookup field of type double and the result should be in between the range 0.1 to 5.0 and should not be in the range 5.1 to 8.9 how to do this in the talend expression filter while mapping in tmap?
Introduction to Talend Open Studio for Data Integration.
Practical steps to developing your data integration strategy.
Create systems and workflow to manage clean data ingestion and data transformation.