One Star

tContext Load From SQL Query

I would like to set a context variable from a SQL Query.
Here is what I have
MSSQLInput -> tMap -> tContextLoad
In the map I map
MSSQLInput - Last_Id variable to a variable in tContextLoad called Contact_Id
When I execute I receive multiple errors about key values
Should I do this a different way?
2 REPLIES
Community Manager

Re: tContext Load From SQL Query

Hello
The schema of tContextLoad is fixed, it has two columns key and value, so you should map the two columns on tMap, define two columns: key and vlaue, set the expression of key column as: "Contact_Id", set the expression of value column as "row1.Last_id" //row1 is the flow name.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: tContext Load From SQL Query

I would like to use a context variable from contextLoad into oracleInput query.
I can see teh key-value pair for tContextLoad. the value I need to use in sql query. How can we use the contextLoad value in a query?