Load Data into database from file and attach filename in a column via tmap

Highlighted
Six Stars

Load Data into database from file and attach filename in a column via tmap

Hi All,

 

I have a batch job which currently loads data from a list of files into a MySQL table. I'm trying to work out how to use tfileproperties to obtain the filename and attach it as an extra column to the exiting dataset via tmap?

 

Below is my current job which works. But not sure where to add in tfileproperties?

 

test.PNG

Moderator

Re: Load Data into database from file and attach filename in a column via tmap

Hello,

You can get tFileProperties through iteration of tFileList and use the CURRENT_FILE globalMap value.

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.

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 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 3

Read about some useful Context Variable ideas

Blog