<?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 tOracleOutput - Null values and defaults in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201326#M3454</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to load a table through the tOracleOutput component. I have a table which has a column defined as:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CREATE TABLE TEST_NULL&lt;BR /&gt;(&lt;BR /&gt;COLUMN1 varchar2(200)&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;, DEFAULT_VALUE NUMBER DEFAULT '-1' NOT NULL&lt;/FONT&gt;&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;now I can't seem to be able to find a working combination, together with the tOracleOutput component, which is able to use this table definition.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I either get nullpointer exceptions in my job, or "cannot insert null value" oracle errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively I see that the tOracleOutput component has got a "default" column, but also from that option I can't seem to find any documentation, or get it to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone has got some advice?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks in advance for your help.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Apr 2017 20:11:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-04-12T20:11:50Z</dc:date>
    <item>
      <title>tOracleOutput - Null values and defaults</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201326#M3454</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to load a table through the tOracleOutput component. I have a table which has a column defined as:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CREATE TABLE TEST_NULL&lt;BR /&gt;(&lt;BR /&gt;COLUMN1 varchar2(200)&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;, DEFAULT_VALUE NUMBER DEFAULT '-1' NOT NULL&lt;/FONT&gt;&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;now I can't seem to be able to find a working combination, together with the tOracleOutput component, which is able to use this table definition.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I either get nullpointer exceptions in my job, or "cannot insert null value" oracle errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively I see that the tOracleOutput component has got a "default" column, but also from that option I can't seem to find any documentation, or get it to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyone has got some advice?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks in advance for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 20:11:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201326#M3454</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-12T20:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: tOracleOutput - Null values and defaults</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201327#M3455</link>
      <description>If DEFAULT_VALUE column is in your tOracleOutput schema, you MUST have a value for it to avoid oracle error.&lt;BR /&gt;The null pointer exception comes from elsewhere.&lt;BR /&gt;I think so.&lt;BR /&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Wed, 12 Apr 2017 20:20:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201327#M3455</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-04-12T20:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: tOracleOutput - Null values and defaults</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201328#M3456</link>
      <description>&lt;P&gt;hi TRF,&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;thanks for the quick reply.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;well, the weird thing is, if I define my column as "MY_COLUMN NUMBER DEFAULT '-1' " (without the "NOT NULL") then the job works fine, but it actually inserts a NULL, instead of using the default value which I specify in my Oracle DDL (or in the "Default" field of the tOracleOutput component). Is there any way to have null's not explicity written?&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;regards&lt;/P&gt; 
&lt;P&gt;Christoph&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 20:24:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201328#M3456</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-12T20:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: tOracleOutput - Null values and defaults</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201329#M3457</link>
      <description>With oracle, default value is set to the associated column only if this column doesn't participate to the insert operation.&lt;BR /&gt;As soon as the field is in Talend schema, the column participate to the insert and the default doesn't apply.</description>
      <pubDate>Wed, 12 Apr 2017 20:33:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201329#M3457</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-04-12T20:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: tOracleOutput - Null values and defaults</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201330#M3458</link>
      <description>OK, in that case what would be the cleanest solution to make sure that my null values get replaced by another value (-1 in this case) I would presume that the "Default" option in the tOracleOutput component is used for that, right? Or is that for something completely different? in which case is this "default" value used, because I can't get it working neither.&lt;BR /&gt;&lt;BR /&gt;thanks!</description>
      <pubDate>Wed, 12 Apr 2017 20:39:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201330#M3458</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-12T20:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: tOracleOutput - Null values and defaults</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201331#M3459</link>
      <description>Do it in tMap&lt;BR /&gt;row1.myColumn == null ? -1 : row1.myColumn</description>
      <pubDate>Wed, 12 Apr 2017 20:49:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201331#M3459</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-04-12T20:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: tOracleOutput - Null values and defaults</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201332#M3460</link>
      <description>&lt;P&gt;That's indeed a solution, but that would be the functionality I would expect from that "Default" column:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Default.JPG" style="width: 400px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ltrh.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/148814i529C705B832F8668/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ltrh.jpg" alt="0683p000009Ltrh.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;But I'll need to search a bit further then to get that working. thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 21:10:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201332#M3460</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-12T21:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: tOracleOutput - Null values and defaults</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201333#M3461</link>
      <description>Not sure it works with tOracleOutput. Some topic about that in the ancient forum.&lt;BR /&gt;Maybe the default defined in the schema can be accessed in Java, but looks a little complicated.</description>
      <pubDate>Wed, 12 Apr 2017 21:16:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201333#M3461</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-04-12T21:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: tOracleOutput - Null values and defaults</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201334#M3462</link>
      <description>&lt;P&gt;According to the documentation, the default value in a schema is only used by certain components:&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.talend.com/display/TalendOpenStudioforDataIntegrationUserGuide63EN/4.3.5+How+to+set+default+values+in+the+schema+of+a+component" target="_blank" rel="nofollow noopener noreferrer"&gt;How to set default values in the schema of a component&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The database output components won't add a default value for you when you write data to Oracle. &amp;nbsp;You'll either need to handle missing values in a tMap or you can potentially handle them on input, depending on what your input source is.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2017 14:16:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201334#M3462</guid>
      <dc:creator>cterenzi</dc:creator>
      <dc:date>2017-04-13T14:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: tOracleOutput - Null values and defaults</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201335#M3463</link>
      <description>&lt;P&gt;thanks all, with all this information I can indeed get it working.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;finally I'll handle it as described in this post:&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCl3sCAC" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/resolved-How-to-set-Float-default-values-in-the-schema/td-p/77334&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2017 16:28:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201335#M3463</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-13T16:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: tOracleOutput - Null values and defaults</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201336#M3464</link>
      <description>&lt;P&gt;First of all, the default value in the schema will only be applied while creating the table and does not have any effect while inserting/updating data.&lt;/P&gt; 
&lt;P&gt;Second, default values in the database will only be applied if you do not have this column in your insert statement!&lt;/P&gt; 
&lt;P&gt;If you simply send null values, the database takes this null value and this will e.g. violate against a not-null-constraint.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The NullPointerException comes typically from the fact, you have in your source a null value (any numeric value) and your table output schema column is a primitive data type like int or long (etc) and now Java tries to unbox the given numeric object to the primnitive data type. This leads to the NullPointerException.&lt;/P&gt; 
&lt;P&gt;Conclusion: Check where you apply a Integer or Long or Double to a int, long or double typed column and take care your source does not send null values here!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2017 19:29:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tOracleOutput-Null-values-and-defaults/m-p/2201336#M3464</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-13T19:29:21Z</dc:date>
    </item>
  </channel>
</rss>

