Update a column values from a CSV or text file before inserting/loading it on a table

Highlighted
Seven Stars

Update a column values from a CSV or text file before inserting/loading it on a table

Hello,

 

I would like to ask if it is possible to update a column values before inserting/loading it onto a table?

Something like in a typical MySQL database trigger, a trigeer before insert

 

for each row
begin
if (NEW.Col_name = 'values1'l) then
set NEW.Col_name = 'values1updated1'; end if;
if (NEW.Col_name = 'value21'l) then
set NEW.Col_name = 'values2updated'; end if;

if (NEW.Col_name = 'values3'l) then
set NEW.Col_name = 'values3updated'; end if;


end
//
delimiter ;

 

 

Or is there any different way to do this?; As I have 1 column with 3 different values depends on the action,  that should be updated, before placing/inserting /loading the data on the target destination table to avoid "Data Column Values is too long"  as I set the standard data types/sizes on the destination table, with a CHAR(1) and the data from the CSV file having CHAR(3).

 

Thank you very much for any idea or a solution.

 

Cheers

 

 


Accepted Solutions
Fifteen Stars TRF
Fifteen Stars

Re: Update a column values from a CSV or text file before inserting/loading it on a table

Pass your data into a tJavaRow or a tMap before to send them to your DB.
This is how it works with Talend DI.

TRF

All Replies
Fifteen Stars TRF
Fifteen Stars

Re: Update a column values from a CSV or text file before inserting/loading it on a table

Pass your data into a tJavaRow or a tMap before to send them to your DB.
This is how it works with Talend DI.

TRF
Seven Stars

Re: Update a column values from a CSV or text file before inserting/loading it on a table

Thank you Sir @TRF! Smiley Happy

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

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch