<?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: Handling null values within dynamic column in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Handling-null-values-within-dynamic-column/m-p/2326699#M96155</link>
    <description>Hello again, 
&lt;BR /&gt;Is it possible for me to do the previous modification : change DynamicUtils.java in \Talend-5.0.2\studio\Talend-Studio-r78327-V5.0.2\plugins\org.talend.desinger.routines.tisprovider_5.0.2.r78327\resources\java\routines\system\ to handle null values differently in my own Talend installation?</description>
    <pubDate>Mon, 30 Apr 2012 11:48:47 GMT</pubDate>
    <dc:creator>lennelei</dc:creator>
    <dc:date>2012-04-30T11:48:47Z</dc:date>
    <item>
      <title>Handling null values within dynamic column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-null-values-within-dynamic-column/m-p/2326695#M96151</link>
      <description>Hello, 
&lt;BR /&gt;I've a job to do : using multiple .xml files as inputs, I've to extract one name and one sql query from each xml file, run the corresponding query and store the result inside a csv file using the name found inside the .xlm for the ouput file (of course, each query returns different columns). 
&lt;BR /&gt;I managed to do it (tFileList &amp;gt; tFileInputXML &amp;gt; tJavaRow &amp;gt; tOracleInput &amp;gt; tFileOutputDelimited) using a single dynamic column between the tOracleInput and the tFileOutputDelimited to handle the different queries; however, I've got trouble handling null values. 
&lt;BR /&gt;To explain this, let's use a more simple job : tOracleInput &amp;gt; tFileOutputDelimited. 
&lt;BR /&gt;With a specific schema (col1 as String, col2 as ...) between the components, null values are printed as empty string in the tFileOutputDelimited. 
&lt;BR /&gt;However, when using a single dynamic column between both components (col1 as Dynamic), null values are printed as "null" string in the tFileOutputDelimited. 
&lt;BR /&gt;Question: is it possible to output null values as empty string when using dynamic column? 
&lt;BR /&gt;Thanks</description>
      <pubDate>Sat, 16 Nov 2024 12:18:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-null-values-within-dynamic-column/m-p/2326695#M96151</guid>
      <dc:creator>lennelei</dc:creator>
      <dc:date>2024-11-16T12:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Handling null values within dynamic column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-null-values-within-dynamic-column/m-p/2326696#M96152</link>
      <description>Hi&lt;BR /&gt;I think it's hard to change the behavior of dynamic schema. But it is easy to replace all null in csv with " " by using tReplace.&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
      <pubDate>Fri, 27 Apr 2012 04:14:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-null-values-within-dynamic-column/m-p/2326696#M96152</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-04-27T04:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Handling null values within dynamic column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-null-values-within-dynamic-column/m-p/2326697#M96153</link>
      <description>Hi,&lt;BR /&gt;thanks for your answer... I agree it's easy unless you're unlucky enough to get a real "null" value as string in your data (hopefully, I'm pretty sure it's not my case, but who knows...) :s&lt;BR /&gt;Another question: is it hard (for me) to change the "null" string used to output null values in the components (to use something we can be sure of: such as "_null_" or even directy an empty string)?</description>
      <pubDate>Fri, 27 Apr 2012 11:44:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-null-values-within-dynamic-column/m-p/2326697#M96153</guid>
      <dc:creator>lennelei</dc:creator>
      <dc:date>2012-04-27T11:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Handling null values within dynamic column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-null-values-within-dynamic-column/m-p/2326698#M96154</link>
      <description>For exemple, I juste have a quick look on the sources, it seems that writeValuesToStringArray function from DynamicUtils.java is used to display data from dynamic column :
&lt;BR /&gt;
&lt;PRE&gt;	public static void writeValuesToStringArray(Dynamic column, String[] row, int offset) {&lt;BR /&gt;		for (int i = 0; i &amp;lt; column.getColumnCount(); i++) {&lt;BR /&gt;			DynamicMetadata metadata = column.getColumnMetadata(i);&lt;BR /&gt;			if ("id_Date".equals(metadata.getType()) &amp;amp;&amp;amp; !(DBMSConstants.MSSQL.getDBmsId().equalsIgnoreCase(column.getDbmsId()) &amp;amp;&amp;amp; !(metadata.getDbType().toLowerCase().indexOf("timestamp") &amp;lt; 0))) {&lt;BR /&gt;				row = FormatterUtils.format_Date((java.util.Date) column.getColumnValue(i),metadata.getFormat());&lt;BR /&gt;			} else {&lt;BR /&gt;				row = String.valueOf(column.getColumnValue(i));&lt;BR /&gt;			}&lt;BR /&gt;		}&lt;BR /&gt;	}&lt;/PRE&gt;
&lt;BR /&gt;I'll probably have to think a bit about this, but what if I replace the line :
&lt;BR /&gt;
&lt;PRE&gt;row = String.valueOf(column.getColumnValue(i));&lt;/PRE&gt;
&lt;BR /&gt;with something like :
&lt;BR /&gt;
&lt;PRE&gt;row = (column.getColumnValue(i) == null)?"":String.valueOf(column.getColumnValue(i));&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Apr 2012 11:58:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-null-values-within-dynamic-column/m-p/2326698#M96154</guid>
      <dc:creator>lennelei</dc:creator>
      <dc:date>2012-04-27T11:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Handling null values within dynamic column</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handling-null-values-within-dynamic-column/m-p/2326699#M96155</link>
      <description>Hello again, 
&lt;BR /&gt;Is it possible for me to do the previous modification : change DynamicUtils.java in \Talend-5.0.2\studio\Talend-Studio-r78327-V5.0.2\plugins\org.talend.desinger.routines.tisprovider_5.0.2.r78327\resources\java\routines\system\ to handle null values differently in my own Talend installation?</description>
      <pubDate>Mon, 30 Apr 2012 11:48:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handling-null-values-within-dynamic-column/m-p/2326699#M96155</guid>
      <dc:creator>lennelei</dc:creator>
      <dc:date>2012-04-30T11:48:47Z</dc:date>
    </item>
  </channel>
</rss>

