Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
good morning, talend in "context.talend" to insert a query
it uses that Syntax in this style:
example 01:
+" SELECT"
+" DISTINCT"
+"CASE"
+" WHEN current_database() = 'credreal' THEN 'CR'"
+" WHEN current_database() = 'city' THEN 'CI'"
+" WHEN current_database() = 'melc' THEN 'ME'"
+"ELSE 'CH'"
+"END as base"
instead of the default:
example2
select distinct
CASE
WHEN current_database() = 'credreal' THEN 'CR'
WHEN current_database() = 'city' THEN 'CI'
WHEN current_database() = 'melc' THEN 'ME'
ELSE 'CH'
END as "Base"
my question is if there is any way to convert from example2 to example1 other than manually.
Hi
You have to type in the query manually if you want to insert variable or use the string concatenator "+", the expression using a context variable in a query like this.
"select * form tableName where key1="+context.varName1+" and key2="+context.varName2
Regards
Shong