<?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: Dynamic schema Postgres to Oracle in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-Postgres-to-Oracle/m-p/2506903#M141787</link>
    <description>&lt;P&gt;Hi! &lt;BR /&gt;the error suggests an incompatibility between PostgreSQL data types and Oracle.&lt;/P&gt;
&lt;P&gt;To fix it you need to know which column is causing the issue, you can modify your code to log column names and their types, I would put a&lt;/P&gt;
&lt;P&gt;System.out.println("Column: " + meta.getName() + &lt;BR /&gt;" | Type: " + meta.getType() + &lt;BR /&gt;" | Length: " + meta.getLength() + &lt;BR /&gt;" | Nullable: " + meta.isNullable());&lt;/P&gt;
&lt;P&gt;betweeen "DynamicMetadata meta = dyn.getColumnMetadata(i);" and "if (meta.getLength() &amp;gt; 4000) {"&lt;/P&gt;</description>
    <pubDate>Fri, 21 Feb 2025 10:33:00 GMT</pubDate>
    <dc:creator>diegozecchini</dc:creator>
    <dc:date>2025-02-21T10:33:00Z</dc:date>
    <item>
      <title>Dynamic schema Postgres to Oracle</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-Postgres-to-Oracle/m-p/2506882#M141785</link>
      <description>&lt;P data-start="50" data-end="53"&gt;Hi,&lt;/P&gt;
&lt;P data-start="55" data-end="244"&gt;We are struggling to build a job using a dynamic schema to move data from PostgreSQL to Oracle. We get the following error when we run the job: &lt;EM data-start="199" data-end="244"&gt;java.sql.SQLException: Invalid column type.&lt;/EM&gt;&lt;/P&gt;
&lt;P data-start="246" data-end="566"&gt;We are using dynamic schemas in other jobs and sometimes use tJavaRow to manipulate the dynamic schema to fit our needs (see example code below). We are not sure how to troubleshoot the "Invalid column type" error. I think it's possible to manipulate the column type, but how do I know which column is causing the issue?&lt;/P&gt;
&lt;P data-start="246" data-end="566"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="246" data-end="566"&gt;Any tips, on moving forward here ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Our code to fix the problem with column lenght, and not null value...&lt;/P&gt;
&lt;DIV&gt;Dynamic dyn = row1.fullskjema;&lt;/DIV&gt;
&lt;DIV&gt;for(int i = 0; i &amp;lt; dyn.getColumnCount(); i++){&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; DynamicMetadata meta = dyn.getColumnMetadata(i);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; if (meta.getLength() &amp;gt;4000 ){&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; meta.setLength(1000);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; else{&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; meta.setLength(meta.getLength());&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; if (meta.getLength() ==8 ){&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; meta.setLength(20);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; else{&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; meta.setLength(meta.getLength());&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; if (meta.isNullable() == false ){&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; meta.setNullable(true);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;}&lt;/DIV&gt;
&lt;DIV&gt;row2.fullskjema = dyn;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 08:56:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-Postgres-to-Oracle/m-p/2506882#M141785</guid>
      <dc:creator>Petterfewf</dc:creator>
      <dc:date>2025-02-21T08:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic schema Postgres to Oracle</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-Postgres-to-Oracle/m-p/2506903#M141787</link>
      <description>&lt;P&gt;Hi! &lt;BR /&gt;the error suggests an incompatibility between PostgreSQL data types and Oracle.&lt;/P&gt;
&lt;P&gt;To fix it you need to know which column is causing the issue, you can modify your code to log column names and their types, I would put a&lt;/P&gt;
&lt;P&gt;System.out.println("Column: " + meta.getName() + &lt;BR /&gt;" | Type: " + meta.getType() + &lt;BR /&gt;" | Length: " + meta.getLength() + &lt;BR /&gt;" | Nullable: " + meta.isNullable());&lt;/P&gt;
&lt;P&gt;betweeen "DynamicMetadata meta = dyn.getColumnMetadata(i);" and "if (meta.getLength() &amp;gt; 4000) {"&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 10:33:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-Postgres-to-Oracle/m-p/2506903#M141787</guid>
      <dc:creator>diegozecchini</dc:creator>
      <dc:date>2025-02-21T10:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic schema Postgres to Oracle</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-Postgres-to-Oracle/m-p/2506904#M141788</link>
      <description>&lt;P&gt;Hi Diegozecchini. Thank for you suggjestion, I will try this code and hopefully be able to locate the column with the incompatibility datatype.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I manage to run the job, with "forcing" all the colum to be string, and only "tune" column size.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the working code.&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;Dynamic dyn = row1.fullskjema;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;for(int i = 0; i &amp;lt; dyn.getColumnCount(); i++){&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; DynamicMetadata meta = dyn.getColumnMetadata(i);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; meta.setType("id_String");&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; if (meta.getLength() &amp;gt;4000 ){&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; meta.setLength(3000);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; else{&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; meta.setLength(100);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;}&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;row2.fullskjema = dyn;&lt;/DIV&gt;</description>
      <pubDate>Fri, 21 Feb 2025 10:53:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-Postgres-to-Oracle/m-p/2506904#M141788</guid>
      <dc:creator>Petterfewf</dc:creator>
      <dc:date>2025-02-21T10:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic schema Postgres to Oracle</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-Postgres-to-Oracle/m-p/2506905#M141789</link>
      <description>&lt;P&gt;That’s a smart workaround! Forcing all columns to id_String ensures that Oracle doesn't reject any incompatible types, and tuning the column size prevents exceeding VARCHAR2 limits.&lt;/P&gt;
&lt;P&gt;Now that the job is running, you can start gradually reintroducing the correct data types where needed&lt;/P&gt;
&lt;P&gt;If you have integer or decimal values stored as strings, they might affect performance or queries. You can use meta.setType("id_Integer") or id_BigDecimal where applicable.&lt;/P&gt;
&lt;P&gt;Let me know if you need further help&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2025 10:56:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Dynamic-schema-Postgres-to-Oracle/m-p/2506905#M141789</guid>
      <dc:creator>diegozecchini</dc:creator>
      <dc:date>2025-02-21T10:56:57Z</dc:date>
    </item>
  </channel>
</rss>

