<?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: Trigger a Job if SQL Database Field changed? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Trigger-a-Job-if-SQL-Database-Field-changed/m-p/2324202#M93933</link>
    <description>Hello Sebastian
&lt;BR /&gt;Do you mean the value of field is changed or the field name is changed? If you point to the filed name, Here I gave you a hint.
&lt;BR /&gt;Before runnning the job for the first time, write download a string of all column name in a file. At the beginning of job, using a tFileInputFullRow to read the string, and using tMssqlColumnList to iterate each column name and concatenate them to a string, compare it with last string of all column name, if it is not equlas, means that the filed name have been change, fires another child job. (See my screenshots)
&lt;BR /&gt;start code on tJavaFlex:
&lt;BR /&gt;
&lt;PRE&gt;// start part of your Java code&lt;BR /&gt;String stringOfAllCurrentColumnName="";&lt;/PRE&gt;
&lt;BR /&gt;main code on tJavaFlex:
&lt;BR /&gt;
&lt;PRE&gt;if(stringOfAllCurrentColumnName.equals("")){&lt;BR /&gt;stringOfAllCurrentColumnName=((String)globalMap.get("tMSSqlColumnList_1_COLUMN_NAME"));&lt;BR /&gt;}else{&lt;BR /&gt;stringOfAllCurrentColumnName=stringOfAllCurrentColumnName+";"+((String)globalMap.get("tMSSqlColumnList_1_COLUMN_NAME"));&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;end code on tJavaFlex:
&lt;BR /&gt;
&lt;PRE&gt;// end of the component, outside/closing the loop&lt;BR /&gt;String lastStringOfAllColumnName=(String)globalMap.get("lastStringOfAllColumnName");&lt;BR /&gt;if(!lastStringOfAllColumnName.equals(stringOfAllCurrentColumnName)){&lt;BR /&gt;context.flag=true;&lt;BR /&gt;}else{&lt;BR /&gt;context.flag=false;&lt;BR /&gt;}&lt;BR /&gt;globalMap.put("stringOfAllCurrentColumnName",stringOfAllCurrentColumnName);&lt;/PRE&gt;
&lt;BR /&gt;Best regards
&lt;BR /&gt; shong</description>
    <pubDate>Mon, 01 Feb 2010 02:48:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-02-01T02:48:42Z</dc:date>
    <item>
      <title>Trigger a Job if SQL Database Field changed?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Trigger-a-Job-if-SQL-Database-Field-changed/m-p/2324201#M93932</link>
      <description>Hello,&lt;BR /&gt;i need a hint for a job:&lt;BR /&gt;I want that the Talend Job run if a field changed in a database (MS SQL Database).&lt;BR /&gt;I can build a 5min Job or anything else. &lt;BR /&gt;Thanks&lt;BR /&gt;Sebastian</description>
      <pubDate>Sat, 16 Nov 2024 13:34:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Trigger-a-Job-if-SQL-Database-Field-changed/m-p/2324201#M93932</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T13:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger a Job if SQL Database Field changed?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Trigger-a-Job-if-SQL-Database-Field-changed/m-p/2324202#M93933</link>
      <description>Hello Sebastian
&lt;BR /&gt;Do you mean the value of field is changed or the field name is changed? If you point to the filed name, Here I gave you a hint.
&lt;BR /&gt;Before runnning the job for the first time, write download a string of all column name in a file. At the beginning of job, using a tFileInputFullRow to read the string, and using tMssqlColumnList to iterate each column name and concatenate them to a string, compare it with last string of all column name, if it is not equlas, means that the filed name have been change, fires another child job. (See my screenshots)
&lt;BR /&gt;start code on tJavaFlex:
&lt;BR /&gt;
&lt;PRE&gt;// start part of your Java code&lt;BR /&gt;String stringOfAllCurrentColumnName="";&lt;/PRE&gt;
&lt;BR /&gt;main code on tJavaFlex:
&lt;BR /&gt;
&lt;PRE&gt;if(stringOfAllCurrentColumnName.equals("")){&lt;BR /&gt;stringOfAllCurrentColumnName=((String)globalMap.get("tMSSqlColumnList_1_COLUMN_NAME"));&lt;BR /&gt;}else{&lt;BR /&gt;stringOfAllCurrentColumnName=stringOfAllCurrentColumnName+";"+((String)globalMap.get("tMSSqlColumnList_1_COLUMN_NAME"));&lt;BR /&gt;}&lt;/PRE&gt;
&lt;BR /&gt;end code on tJavaFlex:
&lt;BR /&gt;
&lt;PRE&gt;// end of the component, outside/closing the loop&lt;BR /&gt;String lastStringOfAllColumnName=(String)globalMap.get("lastStringOfAllColumnName");&lt;BR /&gt;if(!lastStringOfAllColumnName.equals(stringOfAllCurrentColumnName)){&lt;BR /&gt;context.flag=true;&lt;BR /&gt;}else{&lt;BR /&gt;context.flag=false;&lt;BR /&gt;}&lt;BR /&gt;globalMap.put("stringOfAllCurrentColumnName",stringOfAllCurrentColumnName);&lt;/PRE&gt;
&lt;BR /&gt;Best regards
&lt;BR /&gt; shong</description>
      <pubDate>Mon, 01 Feb 2010 02:48:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Trigger-a-Job-if-SQL-Database-Field-changed/m-p/2324202#M93933</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-01T02:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger a Job if SQL Database Field changed?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Trigger-a-Job-if-SQL-Database-Field-changed/m-p/2324203#M93934</link>
      <description>Hi Shong,
&lt;BR /&gt; If it's the value changed, and it's on MySQL DB. how it will be done?
&lt;BR /&gt;Thanks
&lt;BR /&gt;Yong</description>
      <pubDate>Thu, 11 Feb 2010 03:22:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Trigger-a-Job-if-SQL-Database-Field-changed/m-p/2324203#M93934</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-02-11T03:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger a Job if SQL Database Field changed?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Trigger-a-Job-if-SQL-Database-Field-changed/m-p/2324204#M93935</link>
      <description>Hi Shong
&lt;BR /&gt;Can you please show the job when a flag in database changes, an email will be triggered?
&lt;BR /&gt;Meaning, when a boolean field in database is true, I would want to trigger an email. Can you please help on this?
&lt;BR /&gt;
&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 13 Sep 2012 22:20:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Trigger-a-Job-if-SQL-Database-Field-changed/m-p/2324204#M93935</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2012-09-13T22:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Trigger a Job if SQL Database Field changed?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Trigger-a-Job-if-SQL-Database-Field-changed/m-p/2324205#M93936</link>
      <description>@Xan: you should start a new topic but look at tWaitForSqlData.</description>
      <pubDate>Fri, 14 Sep 2012 03:22:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Trigger-a-Job-if-SQL-Database-Field-changed/m-p/2324205#M93936</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2012-09-14T03:22:51Z</dc:date>
    </item>
  </channel>
</rss>

