<?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: Inserting date with time component into a tOracleOutput in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Inserting-date-with-time-component-into-a-tOracleOutput/m-p/2349194#M116199</link>
    <description>I answer to myself in case of someone is facing the same issue in the future.&lt;BR /&gt;&lt;BR /&gt;TalendDate routines manipulate java.util.Date objects.&lt;BR /&gt;But when it's time to persist the object into a database table, a java.sql.Date is created from the java.util.Date object, like this :&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;new java.sql.Date(out1.DATE_DOC.getTime())&lt;/PRE&gt;&lt;BR /&gt;where out1.DATE_DOC is the initial Date object - this object is a full precision date.&lt;BR /&gt;&lt;BR /&gt;The problem is that java.sql.Date objects don't have time parts.&lt;BR /&gt;So when a java.sql.Date object is created from a java.sql.Date object (as shown on pervious snippet), the date is truncated and precision is lost.&lt;BR /&gt;Conclusion : &lt;BR /&gt;- I cannot persist a full precision date (date and time) into a DATE column of a database table without loosing the time precision.&lt;BR /&gt;- To achieve my goal, I created a VARCHAR column in my table for the date and use database side trigger to compute the date.</description>
    <pubDate>Wed, 16 Mar 2016 16:59:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-03-16T16:59:35Z</dc:date>
    <item>
      <title>Inserting date with time component into a tOracleOutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Inserting-date-with-time-component-into-a-tOracleOutput/m-p/2349193#M116198</link>
      <description>&lt;P&gt;Hi guys,&lt;BR /&gt;Using tMap, I try to insert some data into a tOracleOutput.&lt;BR /&gt;I need to map one of date columns on the tOracleOutput as follow :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;TalendDate.parseDate("dd/MM/yyyy HH:mm:ss",TalendDate.formatDate("dd/MM/yyyy",TalendDate.getCurrentDate()).concat(" ").concat(row3.HOUR).concat(":00"),true) &lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;where row3.HOUR is a string column from an input and represents hours (e.g "08:30").&lt;BR /&gt;The purpose of this mapping is to concatenate the current date (eg. 15/03/2016) with the hour component from the input flow row3 (eg. "08:30") and then insert this new date (15/03/2016 08:30) into the database table.&lt;BR /&gt;Unfortunately, date recorded in the database table is truncated : 15/03/2016 00:00:00 while expected is 15/03/2016 08:30:00.&lt;BR /&gt;The same mapping sent to a tLogRow component show the correct output.&lt;BR /&gt;&lt;BR /&gt;I'll be thankfull for any help.&lt;BR /&gt;&lt;BR /&gt;Rado.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2016 15:53:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Inserting-date-with-time-component-into-a-tOracleOutput/m-p/2349193#M116198</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-15T15:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting date with time component into a tOracleOutput</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Inserting-date-with-time-component-into-a-tOracleOutput/m-p/2349194#M116199</link>
      <description>I answer to myself in case of someone is facing the same issue in the future.&lt;BR /&gt;&lt;BR /&gt;TalendDate routines manipulate java.util.Date objects.&lt;BR /&gt;But when it's time to persist the object into a database table, a java.sql.Date is created from the java.util.Date object, like this :&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;new java.sql.Date(out1.DATE_DOC.getTime())&lt;/PRE&gt;&lt;BR /&gt;where out1.DATE_DOC is the initial Date object - this object is a full precision date.&lt;BR /&gt;&lt;BR /&gt;The problem is that java.sql.Date objects don't have time parts.&lt;BR /&gt;So when a java.sql.Date object is created from a java.sql.Date object (as shown on pervious snippet), the date is truncated and precision is lost.&lt;BR /&gt;Conclusion : &lt;BR /&gt;- I cannot persist a full precision date (date and time) into a DATE column of a database table without loosing the time precision.&lt;BR /&gt;- To achieve my goal, I created a VARCHAR column in my table for the date and use database side trigger to compute the date.</description>
      <pubDate>Wed, 16 Mar 2016 16:59:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Inserting-date-with-time-component-into-a-tOracleOutput/m-p/2349194#M116199</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-03-16T16:59:35Z</dc:date>
    </item>
  </channel>
</rss>

