<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Assigning values to context variables in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Assigning-values-to-context-variables/m-p/2228253#M19574</link>
    <description>Hi Dave
&lt;BR /&gt;how many records are fetched from your DB select query?
&lt;BR /&gt;If its more than 1, check if the last record gives a null or blank values.
&lt;BR /&gt;The reason is that you are assigning the values to context in a flow. So for each record processed, the values of context changes.
&lt;BR /&gt;Hope it helps you.
&lt;BR /&gt;It will be better if you put a screen shot.</description>
    <pubDate>Fri, 04 Mar 2011 12:48:53 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-03-04T12:48:53Z</dc:date>
    <item>
      <title>Assigning values to context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Assigning-values-to-context-variables/m-p/2228252#M19573</link>
      <description>Hi all, 
&lt;BR /&gt;Just wondering if you can help me. 
&lt;BR /&gt;I have a DB with 2 columns in it, "filename" &amp;amp; "sql_statement". 
&lt;BR /&gt;I am reading one row from this DB and I want to assign the output to context variables I have created "con_filename" &amp;amp; "con_contents". 
&lt;BR /&gt;I want to then create a file using the value I have stored in "con_filename" and the file being created should be populated with "con_contents". 
&lt;BR /&gt;At the moment I'm selecting the data from the DB fine using a tPostgresqlInput 
&lt;BR /&gt;I am trying to assign the output to context variables here too using a tJavaRow. tJavaRow contains the following. 
&lt;BR /&gt;//Code generated according to input schema and output schema 
&lt;BR /&gt;output_row.filename = input_row.filename; 
&lt;BR /&gt;output_row.sql_statement = input_row.sql_statement; 
&lt;BR /&gt;context.filename = input_row.filename; 
&lt;BR /&gt;context.sql_statement = input_row.sql_statement; 
&lt;BR /&gt;I am then outputting directly to a tFileOutput but I'm getting both values into the file and a null file name. It appears that the context variables never get set. 
&lt;BR /&gt;How do you assign values to context variables. 
&lt;BR /&gt;Thanks in advance, 
&lt;BR /&gt; 
&lt;BR /&gt;Dave</description>
      <pubDate>Sat, 16 Nov 2024 13:03:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Assigning-values-to-context-variables/m-p/2228252#M19573</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T13:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning values to context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Assigning-values-to-context-variables/m-p/2228253#M19574</link>
      <description>Hi Dave
&lt;BR /&gt;how many records are fetched from your DB select query?
&lt;BR /&gt;If its more than 1, check if the last record gives a null or blank values.
&lt;BR /&gt;The reason is that you are assigning the values to context in a flow. So for each record processed, the values of context changes.
&lt;BR /&gt;Hope it helps you.
&lt;BR /&gt;It will be better if you put a screen shot.</description>
      <pubDate>Fri, 04 Mar 2011 12:48:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Assigning-values-to-context-variables/m-p/2228253#M19574</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-04T12:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning values to context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Assigning-values-to-context-variables/m-p/2228254#M19575</link>
      <description>hi, 
&lt;BR /&gt;If you are using context variable to store some value from flow is not a 'best practices' even if it can work 
&lt;IMG id="smileywink" class="emoticon emoticon-smileywink" src="https://yutwg22796.i.lithium.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt; 
&lt;BR /&gt;as lijolawrance said in fact the only value that you have is the lasted one into your context 
&lt;BR /&gt;For that use globalMap and a flowToIterate to catch value from the flow (have a look into codeViewer to be sure about the name (key map) of globalMap var). 
&lt;BR /&gt;It's always 'rowName.fieldName' (ex : row1.firstName) 
&lt;BR /&gt;hope it help</description>
      <pubDate>Sat, 05 Mar 2011 20:19:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Assigning-values-to-context-variables/m-p/2228254#M19575</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-05T20:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning values to context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Assigning-values-to-context-variables/m-p/2228255#M19576</link>
      <description>Cheers for getting back to me on it guys.&lt;BR /&gt;I'll try using the global variables and will let you know how I get on.&lt;BR /&gt;&lt;BR /&gt;Face</description>
      <pubDate>Mon, 07 Mar 2011 09:47:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Assigning-values-to-context-variables/m-p/2228255#M19576</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2011-03-07T09:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning values to context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Assigning-values-to-context-variables/m-p/2228256#M19577</link>
      <description>In reply to your question though LijoLawrance, I am reading in just the one row does this help my cause in making it easier. The value that is being read in is a dynamically changing filename that is created in postgresql. 
&lt;BR /&gt;regards,
&lt;BR /&gt;
&lt;BR /&gt;Face</description>
      <pubDate>Mon, 07 Mar 2011 09:54:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Assigning-values-to-context-variables/m-p/2228256#M19577</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-07T09:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning values to context variables</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Assigning-values-to-context-variables/m-p/2228257#M19578</link>
      <description>Hi Face,&lt;BR /&gt;You can change to what kzone has told.&lt;BR /&gt;In what i have told earlier will fail, if there is any null value (Sorry, i missed it).&lt;BR /&gt;But i still feel that u need to have a null check.</description>
      <pubDate>Mon, 07 Mar 2011 10:34:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Assigning-values-to-context-variables/m-p/2228257#M19578</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-07T10:34:24Z</dc:date>
    </item>
  </channel>
</rss>

