<?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: tDBOutput using UUID as a key for UPDATE in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306893#M78383</link>
    <description>&lt;P&gt;Thank you very much for the reply &lt;A href="https://community.qlik.com/s/profile/00539000004XsaeAAC"&gt;@xdshi&lt;/A&gt;&amp;nbsp;!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Unfortunately I had already gone down that path getting the second error I previously posted:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Exception in component tDBOutput_1 (Update_PG_Records)&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of java.util.UUID. Use setObject() with an explicit Types value to specify the type to use.&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1740)&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#000000"&gt;I took some time to google that error and it is related to the PreparedStatement java class and the java.sql.Types explicit definition in the setObject method. Looking at the code instead of the designer I realized the issue was here:&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="2019-07-03_17-07-57.png" style="width: 567px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M68i.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145921iDD685B8E78EB3D8B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M68i.png" alt="0683p000009M68i.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#000000"&gt;Then I researched the Talend source code and I found the line of code that is causing this exception:&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;A title="db_output_bulk.skeleton Line 2893" href="https://github.com/Talend/tdi-studio-se/blob/592be6abb185e95f88837022234eff83290b5d22/main/plugins/org.talend.designer.components.localprovider/components/templates/db_output_bulk.skeleton#L2893" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://github.com/Talend/tdi-studio-se/blob/592be6abb185e95f88837022234eff83290b5d22/main/plugins/org.talend.designer.components.localprovider/components/templates/db_output_bulk.skeleton#L2893&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm not sure why adding java.sql.Types.OTHER to the setObject is not counting as an explicit Types value but it would be my first guess. Let me know if I'm wrong in any of the previous statements.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Best,&lt;/P&gt; 
&lt;P&gt;Glen.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2019 03:05:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-07-04T03:05:01Z</dc:date>
    <item>
      <title>tDBOutput using UUID as a key for UPDATE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306891#M78381</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm facing an issue when trying to UPDATE records in a postgres table using a UUID field as the key for the update. I've tried feeding a string to the component, and I've also tried using an Object, having a tJavaRow set it to be a java.util.UUID. Here are the errors:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If row key (UUID) is set as an String and passed to tDBOutput:&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Batch entry 0 UPDATE schema.table SET "field_name" = valueHere WHERE "id" = 4d7b30d6-8d59-4cf2-9a0f-feee68659779 was aborted.&amp;nbsp; Call getNextException to see the cause.&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;caused by: ERROR: operator does not exist: uuid = character varying&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;If row key (UUID) is set as an Object and a true UUID is passed to tDBOutput:&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Exception in component tDBOutput_1 (Update_PG_Records)&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of java.util.UUID. Use setObject() with an explicit Types value to specify the type to use.&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1740)&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Let me know if I'm missing something. Seems that the DB Type setting on the component is doing little to nothing.&lt;/P&gt; 
&lt;P&gt;Best,&lt;/P&gt; 
&lt;P&gt;Glen.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 05:28:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306891#M78381</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T05:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: tDBOutput using UUID as a key for UPDATE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306892#M78382</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Refer to &lt;A class="external-link" href="https://stackoverflow.com/questions/17969431/postgres-uuid-jdbc-not-working" target="_blank" rel="nofollow noopener noopener noreferrer"&gt;https://stackoverflow.com/questions/17969431/postgres-uuid-jdbc-not-working&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You pass a uuid String to the field. which should work with UUID type. Please try to convert the UUID string to a UUID type.&lt;/P&gt;
&lt;DIV class="code panel" style="border-width: 1px;"&gt;
&lt;DIV class="codeContent panelContent"&gt;
&lt;PRE class="code-java"&gt;java.util.UUID.fromString()
&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Jul 2019 09:45:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306892#M78382</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-03T09:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: tDBOutput using UUID as a key for UPDATE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306893#M78383</link>
      <description>&lt;P&gt;Thank you very much for the reply &lt;A href="https://community.qlik.com/s/profile/00539000004XsaeAAC"&gt;@xdshi&lt;/A&gt;&amp;nbsp;!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Unfortunately I had already gone down that path getting the second error I previously posted:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Exception in component tDBOutput_1 (Update_PG_Records)&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of java.util.UUID. Use setObject() with an explicit Types value to specify the type to use.&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1740)&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#000000"&gt;I took some time to google that error and it is related to the PreparedStatement java class and the java.sql.Types explicit definition in the setObject method. Looking at the code instead of the designer I realized the issue was here:&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="2019-07-03_17-07-57.png" style="width: 567px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M68i.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145921iDD685B8E78EB3D8B/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M68i.png" alt="0683p000009M68i.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT color="#000000"&gt;Then I researched the Talend source code and I found the line of code that is causing this exception:&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;A title="db_output_bulk.skeleton Line 2893" href="https://github.com/Talend/tdi-studio-se/blob/592be6abb185e95f88837022234eff83290b5d22/main/plugins/org.talend.designer.components.localprovider/components/templates/db_output_bulk.skeleton#L2893" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://github.com/Talend/tdi-studio-se/blob/592be6abb185e95f88837022234eff83290b5d22/main/plugins/org.talend.designer.components.localprovider/components/templates/db_output_bulk.skeleton#L2893&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm not sure why adding java.sql.Types.OTHER to the setObject is not counting as an explicit Types value but it would be my first guess. Let me know if I'm wrong in any of the previous statements.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Best,&lt;/P&gt; 
&lt;P&gt;Glen.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 03:05:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306893#M78383</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-04T03:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: tDBOutput using UUID as a key for UPDATE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306894#M78384</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Could you clarify in which Talend version/edition you are?&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 03:24:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306894#M78384</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-04T03:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: tDBOutput using UUID as a key for UPDATE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306895#M78385</link>
      <description>&lt;P&gt;The problem is indeed PostgreSQL need a cast for object typed values because it is not clear what type the value actually is.&lt;/P&gt; 
&lt;P&gt;There is a trick to do so.&lt;/P&gt; 
&lt;P&gt;You send the data as UUID or also possible as String in a schema column typed as Object (as you already do) and add the cast to the SQL generation.&lt;/P&gt; 
&lt;P&gt;This can be done in the Advanced Settings of the component.&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="uuid_value.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5n2.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/153192i415D962C5DA0C1CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5n2.png" alt="0683p000009M5n2.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;This way you simply replace the automatically generated placeholder SQL code for the uuid typed column with a placeholder containing a cast.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 06:29:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306895#M78385</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-04T06:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: tDBOutput using UUID as a key for UPDATE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306896#M78386</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/0053p000007LKk8AAG"&gt;@lli&lt;/A&gt;&amp;nbsp;!!!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I had not tried the casting in the replacement that way. It still failed when passing as an UUID object but worked like a charm feeding it as a string. The component displays the warning as if there were data type inconsistencies:&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-center" image-alt="2019-07-06_9-17-18.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M6Br.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147195i3D7B05428649FCBD/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M6Br.png" alt="0683p000009M6Br.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&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-center" image-alt="2019-07-06_8-33-11.png" style="width: 715px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M65L.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/153957i48DC3E7DBE07123C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M65L.png" alt="0683p000009M65L.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;but the casting worked 100% and now I can update the table based on the primary key which is a UUID.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;This is what the component looks like for reference:&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-center" image-alt="2019-07-06_8-34-37.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M6Bw.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130347iF8C019F478E9BAA5/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M6Bw.png" alt="0683p000009M6Bw.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jul 2019 16:36:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306896#M78386</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-06T16:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: tDBOutput using UUID as a key for UPDATE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306897#M78387</link>
      <description>&lt;P&gt;Hello everyone !&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm digging this thread from his grave since I have a similar issue but with slightly different setup.&lt;/P&gt; 
&lt;P&gt;Instead of having a Postgre "classic", I have a Postgre on Google Cloud Platorm in target.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;So I'm connecting using a JDBC connector, and the Postgre driver.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I'm having the same need : update a table with it's UUID.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;None of the previous solution worked...&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here's a list of what I tried :&lt;/P&gt; 
&lt;UL&gt; 
 &lt;LI&gt;jlolling solution with cast : I have a "search parameter 2 issue"&lt;/LI&gt; 
 &lt;LI&gt;building a string with the clause " my_id::text='my_row.id' " : nothing happens&lt;/LI&gt; 
 &lt;LI&gt;building a string with the clause " my_id='my_row.id'::uuid " : nothing happens&lt;/LI&gt; 
 &lt;LI&gt;plain text uuid : nothing happens&lt;/LI&gt; 
 &lt;LI&gt;using conversion with UUID functions : no change (even failing)&lt;/LI&gt; 
 &lt;LI&gt;parameter in the connection string : it break the connection because it's JDBC and not supported&lt;/LI&gt; 
&lt;/UL&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Is someone able to update even a single row with a JDBC PostgreSQL target ? after 2 days of tricking Talend into some weird stuff, I've not managed to get it working, neither my colleague...&lt;/P&gt; 
&lt;P&gt;I read addiotional parameters in 7.2 for JDBC Postgre connection. May it resolve my issue ?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Note : If I take the request and put it in pgAdmin, it works like a charm, even with text, no need for uuid type cast&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thank you in advance for your help !&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2019 16:26:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tDBOutput-using-UUID-as-a-key-for-UPDATE/m-p/2306897#M78387</guid>
      <dc:creator>rmartin2</dc:creator>
      <dc:date>2019-08-13T16:26:54Z</dc:date>
    </item>
  </channel>
</rss>

