<?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: Help! Postgres - Bad value for type int in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324857#M94518</link>
    <description>OK, tried that...still get the same error. Here's the new SQL:
&lt;BR /&gt;SELECT 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."cart_id", -1), 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."account_id", -1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."payment_date", 
&lt;BR /&gt; "lucid"."accounting"."cart"."currency_code", 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."exchange_rate", -1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."state_code", 
&lt;BR /&gt; "lucid"."accounting"."cart"."state_name", 
&lt;BR /&gt; coalesce( "lucid"."accounting"."cart"."country_id",-1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."country_code", 
&lt;BR /&gt; "lucid"."accounting"."cart"."zip_code", 
&lt;BR /&gt; "lucid"."accounting"."cart"."payment_type", 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."parent_id",-1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."invoice_status", 
&lt;BR /&gt; "lucid"."accounting"."cart"."invoice_department", 
&lt;BR /&gt; "lucid"."accounting"."cart"."invoice_reason", 
&lt;BR /&gt; "lucid"."accounting"."cart"."distribution_channel", 
&lt;BR /&gt; "lucid"."accounting"."cart"."ingram_note", 
&lt;BR /&gt; "lucid"."accounting"."cart"."revenue_recognition_date", 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."buyer_channel_id", -1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."is_sale_cart", 
&lt;BR /&gt; "lucid"."accounting"."cart"."checkout_date", 
&lt;BR /&gt; "lucid"."accounting"."cart"."sale_date", 
&lt;BR /&gt; "lucid"."accounting"."cart"."ship_method", 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."cart_status_id", -1)
&lt;BR /&gt;FROM "lucid"."accounting"."cart"</description>
    <pubDate>Mon, 28 Nov 2011 19:15:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-11-28T19:15:20Z</dc:date>
    <item>
      <title>Help! Postgres - Bad value for type int</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324852#M94513</link>
      <description>I'm new to TOS, and have gotten about 10 simple jobs working, but I'm getting the below error on 2 jobs and have no idea how to resolve it. 
&lt;BR /&gt;Exception in component tPostgresqlInput_1 
&lt;BR /&gt;org.postgresql.util.PSQLException: Bad value for type int : 
&lt;BR /&gt; at org.postgresql.jdbc2.AbstractJdbc2ResultSet.toInt(AbstractJdbc2ResultSet.java:2699) 
&lt;BR /&gt; at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getInt(AbstractJdbc2ResultSet.java:2016) 
&lt;BR /&gt; at test1_lucid2infinidb.accounting_cart_0_1.Accounting_cart.tPostgresqlInput_1Process(Accounting_cart.java:1019) 
&lt;BR /&gt; at test1_lucid2infinidb.accounting_cart_0_1.Accounting_cart.runJobInTOS(Accounting_cart.java:1681) 
&lt;BR /&gt; at test1_lucid2infinidb.accounting_cart_0_1.Accounting_cart.main(Accounting_cart.java:1549) 
&lt;BR /&gt;There are integer columns that have some null values in the input table (what I thought was originally causing the error), so I tried wrapping a COALESCE(column_name, 0) around the suspected offending columns in the schema query that is issued (which would return the column value or 0 if the column is null), however I still get the same error. I've also tried setting all the integer columns in the schema to string inside of TOS, still no dice. I've searched this forum and found a few similar posts, but I've already tried everything that I've seen suggested. 
&lt;BR /&gt;Here's what the table looks like: 
&lt;BR /&gt; Table "accounting.cart" 
&lt;BR /&gt; Column | Type | Modifiers 
&lt;BR /&gt;--------------------------+--------------------------+----------- 
&lt;BR /&gt; cart_id | integer | not null 
&lt;BR /&gt; account_id | integer | not null 
&lt;BR /&gt; payment_date | timestamp with time zone | not null 
&lt;BR /&gt; currency_code | character varying | not null 
&lt;BR /&gt; exchange_rate | numeric | 
&lt;BR /&gt; state_code | character varying | not null 
&lt;BR /&gt; state_name | character varying | not null 
&lt;BR /&gt; country_id | integer | 
&lt;BR /&gt; country_code | character varying | not null 
&lt;BR /&gt; zip_code | character varying | not null 
&lt;BR /&gt; payment_type | character varying | not null 
&lt;BR /&gt; parent_id | integer | 
&lt;BR /&gt; invoice_status | character varying | 
&lt;BR /&gt; invoice_department | character varying | 
&lt;BR /&gt; invoice_reason | character varying | 
&lt;BR /&gt; distribution_channel | character varying | 
&lt;BR /&gt; ingram_note | character varying | not null 
&lt;BR /&gt; revenue_recognition_date | timestamp with time zone | 
&lt;BR /&gt; buyer_channel_id | integer | not null 
&lt;BR /&gt; is_sale_cart | boolean | not null 
&lt;BR /&gt; checkout_date | timestamp with time zone | 
&lt;BR /&gt; sale_date | timestamp with time zone | 
&lt;BR /&gt; ship_method | character varying | 
&lt;BR /&gt; cart_status_id | integer | not null 
&lt;BR /&gt; 
&lt;BR /&gt;Can anyone help? 
&lt;BR /&gt;Best regards, 
&lt;BR /&gt;Dave Sisk</description>
      <pubDate>Sat, 16 Nov 2024 12:33:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324852#M94513</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Postgres - Bad value for type int</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324853#M94514</link>
      <description>Hi&lt;BR /&gt;Could you show me your SQL statements about COALESCE?&lt;BR /&gt;I guess, indeed, you didn't correct datas in the table. It still has null values.&lt;BR /&gt;Best regards!&lt;BR /&gt;Pedro</description>
      <pubDate>Wed, 23 Nov 2011 02:17:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324853#M94514</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-23T02:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Postgres - Bad value for type int</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324854#M94515</link>
      <description>I don't think I still have that SQL statement handy, but it looked like "SELECT .....coalesce(country_id, 0)....FROM cart".  &lt;BR /&gt;In the metadata definition, the nullable integer columns show as nullable, so TOS knows it could get a null value...why isn't TOS able to handle this already?&lt;BR /&gt;Cheers,&lt;BR /&gt;Dave</description>
      <pubDate>Mon, 28 Nov 2011 15:30:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324854#M94515</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-28T15:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Postgres - Bad value for type int</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324855#M94516</link>
      <description>OK, I re-constructed the SQL statement, here it is...I've put a coalesce(column, -1) around every nullable number column. I still get the error. What am I missing??? 
&lt;BR /&gt;SELECT 
&lt;BR /&gt; "lucid"."accounting"."cart"."cart_id", 
&lt;BR /&gt; "lucid"."accounting"."cart"."account_id", 
&lt;BR /&gt; "lucid"."accounting"."cart"."payment_date", 
&lt;BR /&gt; "lucid"."accounting"."cart"."currency_code", 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."exchange_rate", -1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."state_code", 
&lt;BR /&gt; "lucid"."accounting"."cart"."state_name", 
&lt;BR /&gt; coalesce( "lucid"."accounting"."cart"."country_id",-1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."country_code", 
&lt;BR /&gt; "lucid"."accounting"."cart"."zip_code", 
&lt;BR /&gt; "lucid"."accounting"."cart"."payment_type", 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."parent_id",-1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."invoice_status", 
&lt;BR /&gt; "lucid"."accounting"."cart"."invoice_department", 
&lt;BR /&gt; "lucid"."accounting"."cart"."invoice_reason", 
&lt;BR /&gt; "lucid"."accounting"."cart"."distribution_channel", 
&lt;BR /&gt; "lucid"."accounting"."cart"."ingram_note", 
&lt;BR /&gt; "lucid"."accounting"."cart"."revenue_recognition_date", 
&lt;BR /&gt; "lucid"."accounting"."cart"."buyer_channel_id", 
&lt;BR /&gt; "lucid"."accounting"."cart"."is_sale_cart", 
&lt;BR /&gt; "lucid"."accounting"."cart"."checkout_date", 
&lt;BR /&gt; "lucid"."accounting"."cart"."sale_date", 
&lt;BR /&gt; "lucid"."accounting"."cart"."ship_method", 
&lt;BR /&gt; "lucid"."accounting"."cart"."cart_status_id" 
&lt;BR /&gt;FROM "lucid"."accounting"."cart"</description>
      <pubDate>Mon, 28 Nov 2011 16:00:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324855#M94516</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-28T16:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Postgres - Bad value for type int</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324856#M94517</link>
      <description>Hi...Try putting the COALESCE() around all the int fields including "cart_status_id".  Maybe the null check fires after the type assignment?</description>
      <pubDate>Mon, 28 Nov 2011 16:45:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324856#M94517</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-28T16:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Postgres - Bad value for type int</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324857#M94518</link>
      <description>OK, tried that...still get the same error. Here's the new SQL:
&lt;BR /&gt;SELECT 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."cart_id", -1), 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."account_id", -1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."payment_date", 
&lt;BR /&gt; "lucid"."accounting"."cart"."currency_code", 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."exchange_rate", -1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."state_code", 
&lt;BR /&gt; "lucid"."accounting"."cart"."state_name", 
&lt;BR /&gt; coalesce( "lucid"."accounting"."cart"."country_id",-1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."country_code", 
&lt;BR /&gt; "lucid"."accounting"."cart"."zip_code", 
&lt;BR /&gt; "lucid"."accounting"."cart"."payment_type", 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."parent_id",-1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."invoice_status", 
&lt;BR /&gt; "lucid"."accounting"."cart"."invoice_department", 
&lt;BR /&gt; "lucid"."accounting"."cart"."invoice_reason", 
&lt;BR /&gt; "lucid"."accounting"."cart"."distribution_channel", 
&lt;BR /&gt; "lucid"."accounting"."cart"."ingram_note", 
&lt;BR /&gt; "lucid"."accounting"."cart"."revenue_recognition_date", 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."buyer_channel_id", -1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."is_sale_cart", 
&lt;BR /&gt; "lucid"."accounting"."cart"."checkout_date", 
&lt;BR /&gt; "lucid"."accounting"."cart"."sale_date", 
&lt;BR /&gt; "lucid"."accounting"."cart"."ship_method", 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."cart_status_id", -1)
&lt;BR /&gt;FROM "lucid"."accounting"."cart"</description>
      <pubDate>Mon, 28 Nov 2011 19:15:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324857#M94518</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-28T19:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Postgres - Bad value for type int</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324858#M94519</link>
      <description>I put a LIMIT 1 on the SQL so I only get one row...even the first row generates this error. Here's the SQL for that, and below the SQL is the values of the one returned row (pulled from pgAdmin with the same query). Same number of values, no numerical nulls...I don't see anything wrong with this data. Does anyone see anything I'm missing??? 
&lt;BR /&gt;SELECT 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."cart_id", -1), 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."account_id", -1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."payment_date", 
&lt;BR /&gt; "lucid"."accounting"."cart"."currency_code", 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."exchange_rate", -1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."state_code", 
&lt;BR /&gt; "lucid"."accounting"."cart"."state_name", 
&lt;BR /&gt; coalesce( "lucid"."accounting"."cart"."country_id",-1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."country_code", 
&lt;BR /&gt; "lucid"."accounting"."cart"."zip_code", 
&lt;BR /&gt; "lucid"."accounting"."cart"."payment_type", 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."parent_id",-1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."invoice_status", 
&lt;BR /&gt; "lucid"."accounting"."cart"."invoice_department", 
&lt;BR /&gt; "lucid"."accounting"."cart"."invoice_reason", 
&lt;BR /&gt; "lucid"."accounting"."cart"."distribution_channel", 
&lt;BR /&gt; "lucid"."accounting"."cart"."ingram_note", 
&lt;BR /&gt; "lucid"."accounting"."cart"."revenue_recognition_date", 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."buyer_channel_id", -1), 
&lt;BR /&gt; "lucid"."accounting"."cart"."is_sale_cart", 
&lt;BR /&gt; "lucid"."accounting"."cart"."checkout_date", 
&lt;BR /&gt; "lucid"."accounting"."cart"."sale_date", 
&lt;BR /&gt; "lucid"."accounting"."cart"."ship_method", 
&lt;BR /&gt; coalesce("lucid"."accounting"."cart"."cart_status_id", -1) 
&lt;BR /&gt;FROM "lucid"."accounting"."cart" limit 1 
&lt;BR /&gt;First row: 
&lt;BR /&gt;4983378;59232872;"2011-01-30 14:17:27-05";"USD";1.0000;"FL";"Florida";840;"USA";"33706";"PAYFLOWPRO";-1;"";"";"";"";"";"2011-02-01 20:06:42-05";0;t;"2011-01-30 14:17:30-05";"2011-01-30 14:17:27-05";"LULU_MAIL";500</description>
      <pubDate>Mon, 28 Nov 2011 20:36:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324858#M94519</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-28T20:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Postgres - Bad value for type int</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324859#M94520</link>
      <description>OK, I just create a similar job that reads data from Postgres but outputs the data to a CSV file instead of directly to Infinidb (ie. MySQL with a BI storage engine). I get no input errors from the Postgres driver, and I get a valid CSV output file. Can anyone explain why this would work but outputing to MySQL/Infinidb would cause an input error on the Postgres side?
&lt;BR /&gt;TIA!
&lt;BR /&gt;Dave</description>
      <pubDate>Mon, 28 Nov 2011 21:36:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324859#M94520</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-28T21:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help! Postgres - Bad value for type int</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324860#M94521</link>
      <description>Aha! I think I may have found the issue...the source schema changed without my knowledge, and those changes weren't reflected in the target schema. I used a simple Postgres input and MySQL output components...I assume it was automatically mapping columns in a positional manner. So, the error was actually coming from the target schema...which is quite a confusing since the error message certainly *appeared* to be coming from the input schema.
&lt;BR /&gt;This is worth posting for future folks who get the same confusing error: Check that the source and target schemas match for columns and datatypes.
&lt;BR /&gt;I've got one of the two jobs running...I'll post if there are any new developments.
&lt;BR /&gt;Thx,
&lt;BR /&gt;Dave</description>
      <pubDate>Tue, 29 Nov 2011 16:18:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Help-Postgres-Bad-value-for-type-int/m-p/2324860#M94521</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-29T16:18:46Z</dc:date>
    </item>
  </channel>
</rss>

