<?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 Use a date context.value into an SQL statement in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Use-a-date-context-value-into-an-SQL-statement/m-p/2353340#M119544</link>
    <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;hi set an context value like context.LastUpdate = TalendDate.getCurrentDate();&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Then i have an SQL (MSSQL SERVER) statement which try to ubdate a column with &lt;/P&gt;&lt;P&gt;context.LastUpdate like :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UPDATE My_Table SET UpdateInProgress =0,LastUpdate="+context.LastUpdate+" &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i print my context.LastUpdate got &lt;/P&gt;&lt;P&gt;LastUpdate = "Thu Jul 13 15:16:29 CEST 2023" when i run this job, got error like &lt;/P&gt;&lt;P&gt;"Exception in component tMSSqlRow_1 (JOB_My_Job)&lt;/P&gt;&lt;P&gt;java.sql.SQLException: incorrect Syntaxe near 'Jul'."&lt;/P&gt;&lt;P&gt;does anyone know how can i deal with this ?&lt;/P&gt;&lt;P&gt;thank you all !&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 21:34:58 GMT</pubDate>
    <dc:creator>Sylcha</dc:creator>
    <dc:date>2024-11-15T21:34:58Z</dc:date>
    <item>
      <title>Use a date context.value into an SQL statement</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Use-a-date-context-value-into-an-SQL-statement/m-p/2353340#M119544</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;hi set an context value like context.LastUpdate = TalendDate.getCurrentDate();&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Then i have an SQL (MSSQL SERVER) statement which try to ubdate a column with &lt;/P&gt;&lt;P&gt;context.LastUpdate like :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UPDATE My_Table SET UpdateInProgress =0,LastUpdate="+context.LastUpdate+" &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If i print my context.LastUpdate got &lt;/P&gt;&lt;P&gt;LastUpdate = "Thu Jul 13 15:16:29 CEST 2023" when i run this job, got error like &lt;/P&gt;&lt;P&gt;"Exception in component tMSSqlRow_1 (JOB_My_Job)&lt;/P&gt;&lt;P&gt;java.sql.SQLException: incorrect Syntaxe near 'Jul'."&lt;/P&gt;&lt;P&gt;does anyone know how can i deal with this ?&lt;/P&gt;&lt;P&gt;thank you all !&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 21:34:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Use-a-date-context-value-into-an-SQL-statement/m-p/2353340#M119544</guid>
      <dc:creator>Sylcha</dc:creator>
      <dc:date>2024-11-15T21:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Use a date context.value into an SQL statement</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Use-a-date-context-value-into-an-SQL-statement/m-p/2353341#M119545</link>
      <description>&lt;P&gt;hi @Sylvain CHARRONDIERE​&amp;nbsp;, that's more an sql problem than a compile error. &lt;/P&gt;&lt;P&gt;Probably the format of the date is not fitting the metadata of your table in sql? &lt;/P&gt;&lt;P&gt;Likely, date should be withing quotes, as follow: update my_table set my_date = '2023-07-13'&lt;/P&gt;&lt;P&gt;Have you tried running directly that query via Sql management studio or the client you're using?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 13:43:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Use-a-date-context-value-into-an-SQL-statement/m-p/2353341#M119545</guid>
      <dc:creator>Serphentelm</dc:creator>
      <dc:date>2023-07-13T13:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Use a date context.value into an SQL statement</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Use-a-date-context-value-into-an-SQL-statement/m-p/2353342#M119546</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;if i try to do a&lt;/P&gt;&lt;P&gt;UPDATE My_Table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SET&amp;nbsp;&amp;nbsp;&amp;nbsp;UpdateInProgress = 0, LastUpdate =&amp;nbsp;'Thu Jul 13 15:16:29 CEST 2023'&lt;/P&gt;&lt;P&gt;in a Sql management, that did not work : Échec de la conversion de la date et/ou de l'heure à partir d'une chaîne de caractères.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I may should transform this date string but no idea how....&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 15:32:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Use-a-date-context-value-into-an-SQL-statement/m-p/2353342#M119546</guid>
      <dc:creator>Sylcha</dc:creator>
      <dc:date>2023-07-13T15:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Use a date context.value into an SQL statement</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Use-a-date-context-value-into-an-SQL-statement/m-p/2353343#M119547</link>
      <description>&lt;P&gt;Date management is always troublesome. &lt;/P&gt;&lt;P&gt;I suggest to try using the talend routine getDate instead getCurrentDate. This way you can choose the format output that you desire. Since you want to write it into an SQL Server table, I recommend using this format:  yyyy-MM-dd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 06:40:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Use-a-date-context-value-into-an-SQL-statement/m-p/2353343#M119547</guid>
      <dc:creator>Serphentelm</dc:creator>
      <dc:date>2023-07-14T06:40:03Z</dc:date>
    </item>
  </channel>
</rss>

