<?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: Failed to execute bulk insert statement in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1952878#M3109</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/115309"&gt;@john_wang&lt;/a&gt;&amp;nbsp; for your input.&lt;/P&gt;
&lt;P&gt;We've already isolated the table in a separated task and use VERBOSE log level to debug the error. We could narrow down the column that cause the issue and try the table-level transformation as below:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;CASE $SDSTMP 
	WHEN '0001-01-01 00:00:00' THEN '1900-01-01 00:00:00' 
	WHEN '0000-22-00 00:00:00.000000' THEN '1900-01-01 00:00:00'
	ELSE STRFTIME('%Y-%m-%d %H:%M:%f', $SDSTMP, "UTC") 
END&lt;/LI-CODE&gt;
&lt;P&gt;It worked well so far. We keep monitoring for a few more days.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jul 2022 13:42:09 GMT</pubDate>
    <dc:creator>datnguyen</dc:creator>
    <dc:date>2022-07-07T13:42:09Z</dc:date>
    <item>
      <title>Qlik Replicate- Big Query bulk insert statement failed due to bad data.</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1950298#M3070</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;
&lt;P&gt;We are using Qlik Replicate to pull data from iSeries to BigQuery. There is a "bulk insert" error occasionally occur made tasks fail. After resuming&amp;nbsp; tasks using "Resume processing..." in the web GUI, the tasks keep running fine until the same error occur some days later.&amp;nbsp; That cycle repeats again and again.&lt;/P&gt;
&lt;P&gt;The tables in BigQuery still populated and look good but the error keep pushing up every day raise our concern.&lt;/P&gt;
&lt;P&gt;Please advise.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;[Details]&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;In this example, we have GQSUDC table (same name in iSeries and BigQuery) and GQSUDC__ct (change tracking version).&amp;nbsp; Checking the log file in Qlik replicate, we learnt that the error occurred when Qlik insert back data from&amp;nbsp;attrep_changes table to GQSUDC__ct. There is a "invalid timestamp" error (red highlight in below error message).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Error message from log file:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Failed (retcode -1) to execute statement: 'INSERT INTO `quotedb_raw`.`GQSUDC__ct` (`header__change_seq`,`header__change_oper`,`header__change_mask`,`header__stream_position`,`header__operation`,`header__transaction_id`,`COMPNUM`,`POLNUM`,`SDUSER`,`SDCODE`,`SDSTAT`,`SDACTY`,`SDRRPL`,`SDRTAP`,`SDGRP`,`SDDISPLAY`,`SDVERIFY`,`SDASSN`,`SDTABL`,`SDSDTY`,`TRANSCTION_TYPE_FLAG`,`SDUNIT`,`SDDRVR`,`SDDEEF`,`SDDENT`,`SDRDIS`,`SDDAMT`,`SDPAMT`,`SDPRDS`,`header__timestamp`,`SDSTMP`,`DATA_EXTRACT_DATETM`,`DATA_LOAD_DATETM`,`RRN`) SELECT CAST( `attrep_changes789B3994BFC808E3`.`col1` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col2` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col3` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col4` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col5` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col6` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col7` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col8` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col9` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col10` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col11` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col12` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col13` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col14` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col15` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col16` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col17` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col18` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col19` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col20` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col21` as STRING) , CAST( `attrep_changes789B3994BFC808E3`.`col22` as NUMERIC) , CAST( `attrep_changes789B3994BFC808E3`.`col23` as NUMERIC) , CAST( `attrep_changes789B3994BFC808E3`.`col24` as NUMERIC) , CAST( `attrep_changes789B3994BFC808E3`.`col25` as NUMERIC) , CAST( `attrep_changes789B3994BFC808E3`.`col26` as NUMERIC) , CAST( `attrep_changes789B3994BFC808E3`.`col27` as NUMERIC) , CAST( `attrep_changes789B3994BFC808E3`.`col28` as NUMERIC) , CAST( `attrep_changes789B3994BFC808E3`.`col29` as NUMERIC) , CAST( `attrep_changes789B3994BFC808E3`.`col30` as TIMESTAMP) , CAST( `attrep_changes789B3994BFC808E3`.`col31` as TIMESTAMP) , CAST( `attrep_changes789B3994BFC808E3`.`col32` as TIMESTAMP) , CAST( `attrep_changes789B3994BFC808E3`.`col33` as TIMESTAMP) , CAST( `attrep_changes789B3994BFC808E3`.`col34` as INT64) FROM `quotedb_raw`.`attrep_changes789B3994BFC808E3` WHERE `attrep_changes789B3994BFC808E3`.`seq` &amp;gt;= ? and `attrep_changes789B3994BFC808E3`.`seq` &amp;lt;= ?' [1022502] (ar_odbc_stmt.c:2783)&lt;BR /&gt;00005539: 2022-06-30T01:28:30 [TARGET_APPLY ]E: RetCode: SQL_ERROR SqlState: 42000 NativeError: 70 Message: [Simba][BigQuery] (70) Invalid query: &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Invalid timestamp string "0000-22-00 00:00:00.000000"&lt;/STRONG&gt;&lt;/FONT&gt; [1022502] (ar_odbc_stmt.c:2789)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Dat&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 02:53:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1950298#M3070</guid>
      <dc:creator>datnguyen</dc:creator>
      <dc:date>2022-09-22T02:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to execute bulk insert statement</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1950396#M3074</link>
      <description>&lt;P&gt;do you the error on the same timestamp &amp;nbsp;&lt;STRONG&gt;"0000-22-00 00:00:00.000000" ?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if so, you may want to do a transformation .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Knowledge/Transformation-Date-Time-Invalid-Value-MySQL/ta-p/1826202" target="_blank"&gt;https://community.qlik.com/t5/Knowledge/Transformation-Date-Time-Invalid-Value-MySQL/ta-p/1826202&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 15:38:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1950396#M3074</guid>
      <dc:creator>Steve_Nguyen</dc:creator>
      <dc:date>2022-06-30T15:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to execute bulk insert statement</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1950405#M3075</link>
      <description>&lt;P&gt;Thanks for your reply. We narrowed down the issue is on columns with TIMESTAMP type and we have local transformation for each TIMESTAMP field in table setting.&lt;/P&gt;
&lt;P&gt;I will try the global transformation approach suggested in the given link.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jun 2022 15:47:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1950405#M3075</guid>
      <dc:creator>datnguyen</dc:creator>
      <dc:date>2022-06-30T15:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to execute bulk insert statement</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1952407#M3093</link>
      <description>&lt;P&gt;Updates:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried the solution in Steve's link:&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Knowledge/Transformation-Date-Time-Invalid-Value-MySQL/ta-p/1826202" target="_blank" rel="noopener"&gt;https://community.qlik.com/t5/Knowledge/Transformation-Date-Time-Invalid-Value-MySQL/ta-p/1826202&lt;/A&gt;&amp;nbsp;and let the task run for several days. The same error occur.&lt;/P&gt;
&lt;P&gt;Also, my Qlik Replicate version (7.0.0.356) doesn't support replace value in column in&amp;nbsp; global transformation. I did the transform at table-level transformation in "Table Settings".&lt;/P&gt;
&lt;P&gt;Still looking for the solution.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 13:49:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1952407#M3093</guid>
      <dc:creator>datnguyen</dc:creator>
      <dc:date>2022-07-06T13:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to execute bulk insert statement</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1952432#M3094</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/164705"&gt;@datnguyen&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;looks to me this is a random data error, how about we find out which bad row cause the error? I'd like to suggest:&lt;/P&gt;
&lt;P&gt;1. New a test task which contains the 'problematic' table (&lt;SPAN&gt;GQSUDC&lt;/SPAN&gt;) only, set source_capture to Verbose&lt;/P&gt;
&lt;P&gt;2. Set the task log file&amp;nbsp;"&lt;SPAN&gt;Automatic Rollover" to limit the log file size to 2G&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Set the task log file "Automatic Cleanup" and make sure the Replicate task server have enough free spaces to store the huge log files. And/or set "Resource Control" --&amp;gt; "Disk Space" to make sure the test task will not impact the PROD system.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3. after the problem happens, save the existing task log files;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"Resume" the task again, and save the new task log files.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Compare the 2 set of log files to find out which line (by PK value, or Change Seq number, or RRN which can position the unique row). And compare the change row columns values with DSPJRN result to fully understand why the problem happens.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;4. (Optional) install higher version Replicate eg 2021.11 on a test server to run the same replication job for comparison.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;John.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 14:34:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1952432#M3094</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2022-07-06T14:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to execute bulk insert statement</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1952878#M3109</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/115309"&gt;@john_wang&lt;/a&gt;&amp;nbsp; for your input.&lt;/P&gt;
&lt;P&gt;We've already isolated the table in a separated task and use VERBOSE log level to debug the error. We could narrow down the column that cause the issue and try the table-level transformation as below:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;CASE $SDSTMP 
	WHEN '0001-01-01 00:00:00' THEN '1900-01-01 00:00:00' 
	WHEN '0000-22-00 00:00:00.000000' THEN '1900-01-01 00:00:00'
	ELSE STRFTIME('%Y-%m-%d %H:%M:%f', $SDSTMP, "UTC") 
END&lt;/LI-CODE&gt;
&lt;P&gt;It worked well so far. We keep monitoring for a few more days.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 13:42:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1952878#M3109</guid>
      <dc:creator>datnguyen</dc:creator>
      <dc:date>2022-07-07T13:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Failed to execute bulk insert statement</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1955430#M3171</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/164705"&gt;@datnguyen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If one of the replies helped to resolve the issue, please mark it as a solution &amp;amp; like it to make it easier for others to find.&lt;BR /&gt;Thanks in advance!&lt;/P&gt;
&lt;P&gt;Dana&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jul 2022 18:41:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Qlik-Replicate-Big-Query-bulk-insert-statement-failed-due-to-bad/m-p/1955430#M3171</guid>
      <dc:creator>Dana_Baldwin</dc:creator>
      <dc:date>2022-07-13T18:41:55Z</dc:date>
    </item>
  </channel>
</rss>

