control table

Six Stars

control table

Hi experts

 

I want to send source data in to final ware house every 15 minutes ,So I taught to create a control table in

staging area with DATE,TIMESTAMP as columns 

When the table in the source is updated , for example the source table is (sales_order ) the date column in sales_order is

(sales_order_date ) when the sales_order_date column gets updated the time is greater than TIME_STAMP column in staging then staging table should fetch the data from source to staging .

 

But how to replicate the column in control table in staging to give as condition in source .please help me to do it

or if any other solutions better than this please let me know

Thanks in advance 

 

Regards

Sumanth


Accepted Solutions
Community Manager

Re: control table

Hi
Select the date column both from source table and control table, store the value to context variables for used later. Trigger other business processing using runIf connector based on the comparison result of the two dates. eg:
tmysqlinput--main--tJavaRow1-oncomponentok--tmysqlInput--main--tJavarow2
--runIf--other business processing
on tJavaRow1:
context.sourceDate=input_row.sales_order_date;

on tJavaRow2:
context.controlDate=input_row.TIME_STAMP_COLUMN;

Set the condition of runIf as:
TalendDate.compareDate(context.controlDate, context.sourceDate)==1

Hope it helps you.

Regards
Shong

----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Moderator

Re: control table

Hi,

Would you mind posting your current job design screenshots on forum which will be helpful for us to understand your requirement very weel?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Community Manager

Re: control table

Hi
Select the date column both from source table and control table, store the value to context variables for used later. Trigger other business processing using runIf connector based on the comparison result of the two dates. eg:
tmysqlinput--main--tJavaRow1-oncomponentok--tmysqlInput--main--tJavarow2
--runIf--other business processing
on tJavaRow1:
context.sourceDate=input_row.sales_order_date;

on tJavaRow2:
context.controlDate=input_row.TIME_STAMP_COLUMN;

Set the condition of runIf as:
TalendDate.compareDate(context.controlDate, context.sourceDate)==1

Hope it helps you.

Regards
Shong

----------------------------------------------------------
Talend | Data Agility for Modern Business
Six Stars

Re: control table

Hi,
I'm new to talend I have no idea about
Context variables .
How to create and how to use
Can you please help me with it.
Regards
Sumanth..
Community Manager

Re: control table

Open the Context viewer to create context variables, define the variable name and select the data type, set a default value if needed. In this case, you should select 'Date' type.

Once the variables are defined, you can use the variable like the format: context.varName in the job.
----------------------------------------------------------
Talend | Data Agility for Modern Business
Six Stars

Re: control table

Ok I will try it
Thanks for quick response ..
Four Stars

Re: control table

hello Shong,as per your suggesion i created 2 context variable but when i connecting run if condition it cant be connected to output, and How to set run if condition  (TalendDate.compareDate(context.controlDate, context.sourceDate)==1
) means where to set condition???? i attached the screen shot of my job.

 

Kindly suggest.

Community Manager

Re: control table

Hi
RunIf can't be connected to output , it should be connected to another subjob, eg:
toracleinput1-main-tJavarow1--oncomponentok--tOracleInput2--main--tJavaRow2--runIf--tOracleInput3--main-->tOracleOutput3

The subjob starting from tOracleInput3 is triggered to run only when the condition of runIf is true.

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business