[resolved] tContextLoad - how to use

One Star

[resolved] tContextLoad - how to use

I see how to load context variables using tContextLoad from a text file that has a name-value pair of columns.
How can you use it in other scenarios? Ex: Can you load from an upstream input compoment? Is so, how - cannot get that to work.
Community Manager

Re: [resolved] tContextLoad - how to use

Hello
Ex: Can you load from an upstream input compoment?

Yes, you can load them from any input component, tMysqlInput etc...
Note that you should define the corresponding context vars to mapping the key column, eg:
You are quering the following rows from mysql
host localhost
database talend
username root
password shong
port 3306
You need define the context vars: host,database,username,password,port.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Employee

Re: [resolved] tContextLoad - how to use

David,
Did you have download the Talend documentation which you can find here ? You'll find a description and a use case of "how use the tContextLoad component".
You can also in the LoginPage when you start the produt "Import Talend demo project"; into the project you have several use cases and components in action. We are trying to have a sample of "HOW TO USE" per components for our new users.
From a tMSSQLInput or tOracleInput (metadata schema : 2 columns= key | value) you can try with this following SQL query : "SELECT 'myContextVar', columnA FROM table where id ='3'"
In this example you have a contextVariable named myContextVar and you push the ROW from tOracleInput to the tContextLoad.
The mechanism is pretty much the same if you're working on a dataflow itself. You have to operate with an association KEY/VALUE in all cases.
Best regards
One Star

Re: [resolved] tContextLoad - how to use

David,
Did you have download the Talend documentation which you can find here ? You'll find a description and a use case of "how use the tContextLoad component".
You can also in the LoginPage when you start the produt "Import Talend demo project"; into the project you have several use cases and components in action. We are trying to have a sample of "HOW TO USE" per components for our new users.
From a tMSSQLInput or tOracleInput (metadata schema : 2 columns= key | value) you can try with this following SQL query : "SELECT 'myContextVar', columnA FROM table where id ='3'"
In this example you have a contextVariable named myContextVar and you push the ROW from tOracleInput to the tContextLoad.
The mechanism is pretty much the same if you're working on a dataflow itself. You have to operate with an association KEY/VALUE in all cases.
Best regards

Cannot get this to work. Do not know how to use.
attached image
One Star

Re: [resolved] tContextLoad - how to use

David,
Did you have download the Talend documentation which you can find here ? You'll find a description and a use case of "how use the tContextLoad component".
You can also in the LoginPage when you start the produt "Import Talend demo project"; into the project you have several use cases and components in action. We are trying to have a sample of "HOW TO USE" per components for our new users.
From a tMSSQLInput or tOracleInput (metadata schema : 2 columns= key | value) you can try with this following SQL query : "SELECT 'myContextVar', columnA FROM table where id ='3'"
In this example you have a contextVariable named myContextVar and you push the ROW from tOracleInput to the tContextLoad.
The mechanism is pretty much the same if you're working on a dataflow itself. You have to operate with an association KEY/VALUE in all cases.
Best regards


Cannot get this to work. Do not know how to use.
attached image

Community Manager

Re: [resolved] tContextLoad - how to use

Hello
Add a tMap between tOracleInput and tContextLoad to change the column name.
See my screenshots.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] tContextLoad - how to use

For your example, do I have to first have to define context variables? Or, does the context variable get created automaticallym named as name of the value in the key ?
Dave
Community Manager

Re: [resolved] tContextLoad - how to use

Hello Dave
Yes, you must define the context vars mapping the key column first.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] tContextLoad - how to use

thanks - I will try that.
Dave