Create logs files of insert/updates of Target table
Dear All,
Scenario
source 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.
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
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
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
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
If your output is file, then you will get a system variable associate to count inserted / rejected... ((Integer)globalMap.get("tFileRowCount_1_COUNT"))