<?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: Oracle DB - write datetime in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252485#M36115</link>
    <description>Hi Vapukov, hi forum 
&lt;BR /&gt;Can you write an example of use of your format "EEE MMM dd HH:mm:ss Z yyyy" ? 
&lt;BR /&gt;If I use it in the function 
&lt;BR /&gt; 
&lt;PRE&gt;System.out.println(TalendDate.parseDate("EEE MMM dd HH:mm:ss Z yyyy", "" + row1.MyDate));&lt;/PRE&gt; 
&lt;BR /&gt; it not works 
&lt;BR /&gt; 
&lt;PRE&gt;Exception in component tMap_1&lt;BR /&gt;java.lang.RuntimeException: java.text.ParseException: Unparseable date: "Mon Nov 21 07:23:17 CET 2016"&lt;/PRE&gt; 
&lt;BR /&gt;However my purpose is to copy a date time field from a table to another without transformations. 
&lt;BR /&gt;If I wish to do the same thing in SQL I use the command: 
&lt;BR /&gt; 
&lt;PRE&gt;TO_DATE('2016-11-21 08:08:08', 'YYYY-MM-DD HH24:MI:SS') &lt;/PRE&gt; 
&lt;BR /&gt;and I'm looking for a correct expression 
&lt;B&gt;to write a date in an Oracle DB table&lt;/B&gt; 
&lt;BR /&gt;Regards</description>
    <pubDate>Mon, 21 Nov 2016 09:04:59 GMT</pubDate>
    <dc:creator>AlessandroCic</dc:creator>
    <dc:date>2016-11-21T09:04:59Z</dc:date>
    <item>
      <title>Oracle DB - write datetime</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252483#M36113</link>
      <description>Hi 
&lt;BR /&gt;In an Oracle DB (version 8.1.7.1.0) I simply would like to create a mirror copy to an existing table. 
&lt;BR /&gt;One of its fields is a DateTime and when I transfer the data I have the error: 
&lt;BR /&gt; 
&lt;PRE&gt;Exception in component tOracleOutput_1&lt;BR /&gt;java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.sql.Date&lt;BR /&gt;	at oracle.jdbc.driver.OraclePreparedStatement.setObject&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;I tred to setting the model data for the field in "yyyy-MM-dd hh:mm:ss" and in an expression I converted the original date in a text and and then I re-format it in a date 
&lt;BR /&gt; 
&lt;PRE&gt;String sDate =&lt;BR /&gt;TalendDate.getPartOfDate("YEAR",row1.DateInput) + "-" +&lt;BR /&gt;TalendDate.getPartOfDate("MONTH",row1.DateInput) + "-" +&lt;BR /&gt;TalendDate.getPartOfDate("DAY_OF_MONTH",row1.DateInput) + " " +&lt;BR /&gt;TalendDate.getPartOfDate("HOUR_OF_DAY",row1.DateInput) + ":" + &lt;BR /&gt;TalendDate.getPartOfDate("MINUTE",row1.DateInput) &amp;nbsp;+ ":" +&lt;BR /&gt;TalendDate.getPartOfDate("SECOND",row1.DateInput);&lt;BR /&gt;Var.dDateOut = TalendDate.parseDate("yyyy-mm-dd HH:mm:ss", sDate);&lt;/PRE&gt; 
&lt;BR /&gt; but I have the same error. 
&lt;BR /&gt;If I print the values of my variable I have: 
&lt;BR /&gt; 
&lt;PRE&gt;DateInput	Fri Nov 11 07:23:06 CET 2016&lt;BR /&gt;DateInString	2016-10-11 7:23:6&lt;BR /&gt;DateOut	Tue Oct 11 07:23:06 CEST 2016&lt;/PRE&gt; 
&lt;BR /&gt;Where the date It's appear correct in the format but with a different month but not valid to insert in the table. 
&lt;BR /&gt;Can you help me? 
&lt;BR /&gt;Regards 
&lt;BR /&gt;Alessandro</description>
      <pubDate>Fri, 11 Nov 2016 12:22:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252483#M36113</guid>
      <dc:creator>AlessandroCic</dc:creator>
      <dc:date>2016-11-11T12:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle DB - write datetime</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252484#M36114</link>
      <description>You can parse and format this date direct, by use 
&lt;B&gt;"EEE MMM dd HH:mm:ss Z yyyy"&lt;/B&gt; date pattern&amp;nbsp;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;IMG src="https://community.talend.com/legacyfs/online/membersTempo/403111/Screen_Shot_2016-11-12_at_2.28.16_AM.png.png" /&gt;</description>
      <pubDate>Fri, 11 Nov 2016 13:26:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252484#M36114</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2016-11-11T13:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle DB - write datetime</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252485#M36115</link>
      <description>Hi Vapukov, hi forum 
&lt;BR /&gt;Can you write an example of use of your format "EEE MMM dd HH:mm:ss Z yyyy" ? 
&lt;BR /&gt;If I use it in the function 
&lt;BR /&gt; 
&lt;PRE&gt;System.out.println(TalendDate.parseDate("EEE MMM dd HH:mm:ss Z yyyy", "" + row1.MyDate));&lt;/PRE&gt; 
&lt;BR /&gt; it not works 
&lt;BR /&gt; 
&lt;PRE&gt;Exception in component tMap_1&lt;BR /&gt;java.lang.RuntimeException: java.text.ParseException: Unparseable date: "Mon Nov 21 07:23:17 CET 2016"&lt;/PRE&gt; 
&lt;BR /&gt;However my purpose is to copy a date time field from a table to another without transformations. 
&lt;BR /&gt;If I wish to do the same thing in SQL I use the command: 
&lt;BR /&gt; 
&lt;PRE&gt;TO_DATE('2016-11-21 08:08:08', 'YYYY-MM-DD HH24:MI:SS') &lt;/PRE&gt; 
&lt;BR /&gt;and I'm looking for a correct expression 
&lt;B&gt;to write a date in an Oracle DB table&lt;/B&gt; 
&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 21 Nov 2016 09:04:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252485#M36115</guid>
      <dc:creator>AlessandroCic</dc:creator>
      <dc:date>2016-11-21T09:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle DB - write datetime</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252486#M36116</link>
      <description>You have error in&amp;nbsp; 
&lt;BR /&gt; 
&lt;PRE&gt;System.out.println(TalendDate.parseDate("EEE MMM dd HH:mm:ss Z yyyy", ___"DELETE THIS" +____ row1.MyDate));&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;IMG src="https://community.talend.com/legacyfs/online/membersTempo/403111/Screen_Shot_2016-11-21_at_10.16.48_PM.png.png" /&gt;&amp;nbsp; 
&lt;BR /&gt; 
&lt;IMG src="https://community.talend.com/legacyfs/online/membersTempo/403111/Screen_Shot_2016-11-21_at_10.15.48_PM.png_20161121-0118.png" /&gt;&amp;nbsp; 
&lt;BR /&gt; 
&lt;IMG src="https://community.talend.com/legacyfs/online/membersTempo/403111/Screen_Shot_2016-11-21_at_10.14.41_PM.png_20161121-0118.png" /&gt;</description>
      <pubDate>Mon, 21 Nov 2016 09:16:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252486#M36116</guid>
      <dc:creator>vapukov</dc:creator>
      <dc:date>2016-11-21T09:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle DB - write datetime</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252487#M36117</link>
      <description>Hi Vapukov 
&lt;BR /&gt;If I delete the empty string "" 
&lt;BR /&gt; 
&lt;PRE&gt;TalendDate.parseDate("EEE MMM dd HH:mm:ss Z yyyy", row1.MyDate)&lt;/PRE&gt; 
&lt;BR /&gt;I have the error: 
&lt;BR /&gt; 
&lt;IMG src="https://community.talend.com/legacyfs/online/membersTempo/44934/immagine.png.png" /&gt;It's regular, you start from a string and you haven't the necessity to convert it. 
&lt;BR /&gt;My code convert date to string: 
&lt;BR /&gt; 
&lt;PRE&gt;TalendDate.parseDate("EEE MMM dd HH:mm:ss Z yyyy", "" + row1.MyDate)&lt;/PRE&gt; 
&lt;BR /&gt;I tried to create a job like your 
&lt;BR /&gt; 
&lt;IMG src="https://community.talend.com/legacyfs/online/membersTempo/44934/Immagine4.jpg.jpg" /&gt; 
&lt;BR /&gt;but I still get the error: 
&lt;BR /&gt; 
&lt;IMG src="https://community.talend.com/legacyfs/online/membersTempo/44934/Immagine5.jpg.jpg" /&gt; 
&lt;BR /&gt; 
&lt;PRE&gt;Inizio job New: 15:33 21/11/2016.&lt;BR /&gt; connecting to socket on port 3668&lt;BR /&gt; connected&lt;BR /&gt;Exception in component tMap_1&lt;BR /&gt;java.lang.RuntimeException: java.text.ParseException: Unparseable date: "Mon Nov 21 07:23:17 CET 2016"&lt;BR /&gt;	at routines.TalendDate.parseDate(TalendDate.java:895)&lt;BR /&gt;	at routines.TalendDate.parseDate(TalendDate.java:839)&lt;BR /&gt;&lt;/PRE&gt; 
&lt;BR /&gt;In any case are you unable to write your value in an Oracle database date field?</description>
      <pubDate>Mon, 21 Nov 2016 14:45:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252487#M36117</guid>
      <dc:creator>AlessandroCic</dc:creator>
      <dc:date>2016-11-21T14:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle DB - write datetime</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252488#M36118</link>
      <description>Up.
&lt;BR /&gt;Is there no one who writes or updates a date-time field in Oracle?
&lt;BR /&gt;On sql the syntax is:
&lt;BR /&gt;
&lt;PRE&gt;to_date('2016-11-23 10:15:31', 'YYYY-MM-DD HH24:MI:SS')&lt;/PRE&gt;
&lt;BR /&gt;How can I white or update my date in Talend?
&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 23 Nov 2016 09:15:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252488#M36118</guid>
      <dc:creator>AlessandroCic</dc:creator>
      <dc:date>2016-11-23T09:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle DB - write datetime</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252489#M36119</link>
      <description>Hi 
&lt;BR /&gt;First of all, there is no "date-time field" in Oracle. There is DATE (which can also hold the time), there is TIMESTAMP and then there is TIMESTAMP WITH TIMEZONE. Are you by any chance trying to convert a TIMESTAMP WITH TIMEZONE into a DATE? Please try the following (nothing is tested): 
&lt;BR /&gt; 
&lt;BR /&gt;Change your input column to type "Date" (DB type should be set to the type in your database) 
&lt;BR /&gt;Change the date format&amp;nbsp;in this column (Modello data) to the source Oracle date/timestamp format - in your case it should be "EEE MMM dd HH:mm:ss Z yyyy" (assuming you are reading from a TIMESTAMP WITH TIMEZONE column). 
&lt;BR /&gt;Change your expression to "row1.MyDate". 
&lt;BR /&gt;Change the date format&amp;nbsp;in this column (Modello data) to the target Oracle&amp;nbsp;date/timestamp format - I believe you are trying to use "yyyy-MM-dd HH:mm:ss". 
&lt;BR /&gt;Use "Date" in the schema of the output component and the appropriate DB type (I assume it is DATE). 
&lt;BR /&gt; 
&lt;BR /&gt;Please note that there are some factors playing into this, therefore, we cannot simply provide you with a perfect solution. You will have to try to understand the Java and Oracle date patterns and how Talend reads and converts dates and timestamps from/into DB columns. You will have to play around with this. 
&lt;BR /&gt; 
&lt;BR /&gt;Another way could be to create the query manually&amp;nbsp;in the "Query" field of tOracleInput using the TO_DATE() function returning the correct format for the target. Then you can simply pass this on as a string. 
&lt;BR /&gt; 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Joachim</description>
      <pubDate>Wed, 23 Nov 2016 11:11:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252489#M36119</guid>
      <dc:creator>JR1</dc:creator>
      <dc:date>2016-11-23T11:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle DB - write datetime</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252490#M36120</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;In oracleOutput component -&amp;gt; advanced settings &lt;/P&gt;&lt;P&gt;uncheck checkbox against "Use Timestamp for Date types"&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 11:03:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Oracle-DB-write-datetime/m-p/2252490#M36120</guid>
      <dc:creator>mboss1649680202</dc:creator>
      <dc:date>2022-04-13T11:03:41Z</dc:date>
    </item>
  </channel>
</rss>

