Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear's,
I have a requirement , in which i have a sql query and i need to classified the output to default value ex:-TEST
The sql query has one column and it will fetch me 100 rows with different id's
Now once i get the output i need to pass a default value 'TEST' to that column
query is : select * from table where id<=5 , i need to pass this query and generate output as below
ex: if the query gives me 5 rows , With different values like below
ID
1
2
3
4
5
My output should be
ID
TEST
TEST
TEST
TEST
TEST
Basically i need to classify using the query .
how shall i do it using talend?
Please help will be appreciated.
Hi Ami,
It sounds like you want to mask your data. You have two ways:
1. Your mapping. A tMap will typically map the input_row.id --> out_row.id. Your mapping expression can be a constant. So out_row_id can be simply mapped to a constant "TEST".
2. You can also explore the Data Masking features available in Talend, very flexible and versatile. Watch this video for a quick demo:
https://www.youtube.com/watch?v=YTl8IgaoZv8
If you want your value to be a parameter, check how to use Context variables here:
HTH
Gene
Just try to replace your query by this one:
select 'TEST' as ID from table where id<=5
Regards
TRF