Create logs files of insert/updates of Target table

Four Stars RSH
Four Stars

Create logs files of insert/updates of Target table

Dear All,
ScenarioSmiley Sadsource and target both are sql server)
I have an source table having query as= " select ID, NAME from table A"
connected to tmap and then linked to target table B.
Requirement:
After migrating data of table A to B , I want to create an LOG file(.text) which should have
NBLine_inserted_ID = ( its an number of line which are inserted in table B from table A for column ID)
NBLine_inserted_NAME= ( its an number of line which are inserted in table B from table A for column NAME)
My Understanding:
In talend for output component we have properties like "NB lines inserted" or "updated" or "rejected" etc , which is on table level calculation , But I am not aware how to count this number of records on each column level (example: B.ID=count(ID from table A) and B.Name=Count(Name from Table A). ( in this scenario we can have rejected data so how to exact numbers for both columns excluding rejected data.
Please guide for above issue.
Thanks in Advance.
Four Stars

Re: Create logs files of insert/updates of Target table

Talend does not differentiate between columns... it considers rows only which includes all the columns...
OnsubjobOk link after your job use tfixedflow--->tfileoutput component and output that system variable data for counts..
Vaibhav
Four Stars RSH
Four Stars

Re: Create logs files of insert/updates of Target table

Hello Vaibhav,
Thank you for reply. Can you please provide me exact job flow. Tfixflowinput component I have never used , so not sure how it work or how to utilize this component( in my situation I required count of ID and Name)
Thanks for your efforts and guidance.
Regards
RSH
Four Stars

Re: Create logs files of insert/updates of Target table

yourjob
|
|
OnSubJobOk
|
|
tFixedFlowInput--->DBOutput
inside tfixedflow component
- create metadata for your columns
- Column names will automatically appear
- Use ^Space to insert the system variable and context variables for values
Vaibhav
Four Stars RSH
Four Stars

Re: Create logs files of insert/updates of Target table

myjob
||
||
subjob ok
||
||
tFixedFlowInput==> tfileoutputDelimited( text file which will be created at last which contains LOGS of insertion)
tFixedFlowinput has 2 columns in metadata(id, Name).
In Values what should be mentioned to get me an exact count ?
I am bit cofuse , for getting count from tfixflowinput Component.
Regards
Four Stars

Re: Create logs files of insert/updates of Target table

If your output is file, then you will get a system variable associate to count inserted / rejected...
((Integer)globalMap.get("tFileRowCount_1_COUNT"))

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

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 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now