<?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: Execute Redshift query from Table column in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371019#M134002</link>
    <description>&lt;P&gt;Hi Shong,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My aim is when query fail it will update audit table with error message. Or if any other component fail it also catch the error and update the audit table with error. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) you think my OnSubjobError tDBRow_4 will get all the errors. If yes how i can capture the error message. I'm not sure under which global variable it store that error message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) I added tLogCather_1 with tJavaRow_1 just to get error message from cather and then write to tJava_5. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In tJavaRow_1 i'm putting this text:&lt;/P&gt;&lt;P&gt;context.error_message = StringHandling.EREPLACE(input_row.message,"'","");&lt;/P&gt;&lt;P&gt;I'm assigning message to context and then with tJava_5 i want to print the error but its coming up as "log cather: ()". I'm using tJava just to check if message is printing or not then i will change this to tDBRow to store in table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In tJava_5 i added this code:&lt;/P&gt;&lt;P&gt;System.out.println("log cather: ("+ context.error_message +")");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help Shong.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000KAUbCAAX.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136104i756C57FB301C2F26/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000KAUbCAAX.png" alt="0695b00000KAUbCAAX.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Oct 2021 04:06:44 GMT</pubDate>
    <dc:creator>Tan</dc:creator>
    <dc:date>2021-10-14T04:06:44Z</dc:date>
    <item>
      <title>Execute Redshift query from Table column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371013#M133996</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm currently learning TOS and trying to create a simple job.&lt;/P&gt;&lt;P&gt;My requirement is to read Redshift query from table one by one and then execute them.(I have a table with query column which stores different queries in each row).&lt;/P&gt;&lt;P&gt;I need to pick 1st query from table then run and save status to audit table and then pick second and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before executing query i need to insert 'Started' status in redshift audit table. After execution if that query run successfully then update that status to 'Success'.&lt;/P&gt;&lt;P&gt;If query fail then update status to 'Fail'.&lt;/P&gt;&lt;P&gt; Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:37:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371013#M133996</guid>
      <dc:creator>Tan</dc:creator>
      <dc:date>2024-11-15T23:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Execute Redshift query from Table column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371014#M133997</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Using tFlowToIterat to iterate each query, the job design looks like:&lt;/P&gt;&lt;P&gt;main job:&lt;/P&gt;&lt;P&gt;tRedshiftInput--main--tFlowToIterate--iterate--tRunJob&lt;/P&gt;&lt;P&gt;tRunjob: pass the current query to child job, refer to this &lt;A href="https://help.talend.com/r/en-US/7.3/orchestration/trunjob-tflowtoiterate-tfileinputdelimited-tjava-creating-parent-job-to-pass-value-to-child-job-standard-component-you-have" alt="https://help.talend.com/r/en-US/7.3/orchestration/trunjob-tflowtoiterate-tfileinputdelimited-tjava-creating-parent-job-to-pass-value-to-child-job-standard-component-you-have" target="_blank"&gt;article &lt;/A&gt;to learn how to  pass a value from parent job to child job.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;child job:&lt;/P&gt;&lt;P&gt;tRedShiftRow1 (insert 'Started' Status to audit table)&lt;/P&gt;&lt;P&gt; |onsubjobok&lt;/P&gt;&lt;P&gt;tRedShiftRow2 (execute current query)&lt;/P&gt;&lt;P&gt;-onsubjobok--tRedShiftRow3 (update status with 'Success')&lt;/P&gt;&lt;P&gt;-onsubjoberror--tRedShiftRow3 (update status with 'Fail')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 01:22:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371014#M133997</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-13T01:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Execute Redshift query from Table column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371015#M133998</link>
      <description>&lt;P&gt;Thanks for quick response Shong.&lt;/P&gt;&lt;P&gt;I tried the solution and i think i'm almost there.&lt;/P&gt;&lt;P&gt;Only one item where i need your help.&lt;/P&gt;&lt;P&gt;How i can insert error message to audit table in case of error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sharing parent and child job images: hope i designed correctly.&lt;/P&gt;&lt;P&gt;Parent:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000JQ5q5AAD.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133368i16C4720CB5A6714A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000JQ5q5AAD.png" alt="0695b00000JQ5q5AAD.png" /&gt;&lt;/span&gt;Child:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000JQ5qKAAT.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144681i7E78230FDE692CFF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000JQ5qKAAT.png" alt="0695b00000JQ5qKAAT.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 09:08:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371015#M133998</guid>
      <dc:creator>Tan</dc:creator>
      <dc:date>2021-10-13T09:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Execute Redshift query from Table column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371016#M133999</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;You want to insert status 'Fail' or the error message into audit table? If latter, you need to use a tLogCatcher to capture the error message, please refer to the component documentation and learn this component. &lt;/P&gt;&lt;P&gt;Let me know if you have any questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 01:12:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371016#M133999</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-14T01:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Execute Redshift query from Table column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371017#M134000</link>
      <description>&lt;P&gt;Thanks Shong, so something like this in child job or parent job?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000KAPJNAA5.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145605i42AD6795E96EEE31/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000KAPJNAA5.png" alt="0695b00000KAPJNAA5.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 02:23:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371017#M134000</guid>
      <dc:creator>Tan</dc:creator>
      <dc:date>2021-10-14T02:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Execute Redshift query from Table column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371018#M134001</link>
      <description>&lt;P&gt;Yes, if you want to filter columns or add extra columns, add a tMap or tFiterRow after tLogCatcher. &lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 02:33:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371018#M134001</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-14T02:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Execute Redshift query from Table column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371019#M134002</link>
      <description>&lt;P&gt;Hi Shong,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My aim is when query fail it will update audit table with error message. Or if any other component fail it also catch the error and update the audit table with error. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) you think my OnSubjobError tDBRow_4 will get all the errors. If yes how i can capture the error message. I'm not sure under which global variable it store that error message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) I added tLogCather_1 with tJavaRow_1 just to get error message from cather and then write to tJava_5. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In tJavaRow_1 i'm putting this text:&lt;/P&gt;&lt;P&gt;context.error_message = StringHandling.EREPLACE(input_row.message,"'","");&lt;/P&gt;&lt;P&gt;I'm assigning message to context and then with tJava_5 i want to print the error but its coming up as "log cather: ()". I'm using tJava just to check if message is printing or not then i will change this to tDBRow to store in table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In tJava_5 i added this code:&lt;/P&gt;&lt;P&gt;System.out.println("log cather: ("+ context.error_message +")");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help Shong.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000KAUbCAAX.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136104i756C57FB301C2F26/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000KAUbCAAX.png" alt="0695b00000KAUbCAAX.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 04:06:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371019#M134002</guid>
      <dc:creator>Tan</dc:creator>
      <dc:date>2021-10-14T04:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Execute Redshift query from Table column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371020#M134003</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;Change the job to be as below:&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;tLogCatcher--row1--&amp;gt;tJavaRow--oncomponentok--tJava_5-oncomponentok--tDBRow_4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't need to use onSubjobError to trigger tDBRow_4 any more if you use tLogCatcher to capture the error whenever an error occurs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 01:24:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371020#M134003</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-15T01:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Execute Redshift query from Table column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371021#M134004</link>
      <description>&lt;P&gt;Thanks for your reply Shong,&lt;/P&gt;&lt;P&gt;While waiting for reply i changed the job as per screenshot below.&lt;/P&gt;&lt;P&gt;I'm picking origin and message from tLogCather and passing to context via tJavaRow.  And then updating my audit table with this error message. This sounds correct to you?&lt;/P&gt;&lt;P&gt;You mentioned i don't need to keep OnSubjobError tDBRow_4 because now Cather will catch all the errors. Is there is any issue if i keep that part.  Appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000KAewKAAT.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/136011i0D555A3764B08A9B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000KAewKAAT.png" alt="0695b00000KAewKAAT.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 04:30:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371021#M134004</guid>
      <dc:creator>Tan</dc:creator>
      <dc:date>2021-10-15T04:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Execute Redshift query from Table column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371022#M134005</link>
      <description>&lt;P&gt;if tDBRow4 and tDBRow5 execute the same query, the query will be executed two times.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 07:30:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Execute-Redshift-query-from-Table-column/m-p/2371022#M134005</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-15T07:30:02Z</dc:date>
    </item>
  </channel>
</rss>

