How to Check if all the columns are present in the excel file or not before loading into DB using Java component ?

Five Stars

How to Check if all the columns are present in the excel file or not before loading into DB using Java component ?

Hi,

I want to load an excel file into DB , before that I need to check if all the columns are present in the file or not.

Also I want which column is missing.[column names will be same every time I receive a new file].

 

Thanks

Suman

Highlighted
Sixteen Stars

Re: How to Check if all the columns are present in the excel file or not before loading into DB using Java component ?

Load your Excel file into your job using a preset schema, then test using a tMap to see if all expected columns are populated. Load the results into a tHashOutput. If any column is missing (or holding the incorrect type), either fail the job with a message (using a tDie) or simply do not progress to the next SubJob. The next SubJob will take your data added to the tHashOutput and carry on the processing using a tHashInput to read it back in.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.