<?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: Truncate &amp;lt;...&amp;gt; cascade in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Truncate-lt-gt-cascade/m-p/2321497#M91523</link>
    <description>&lt;P&gt;Can you truncate "user_role"? I assume you can since you are truncating "user". Since there's a referential constraint, any records left in "user_role" would likely be pointless.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;U&gt;I am completely speculating based on the little info you gave me! Please ensure truncating "user_role" would not cause any adverse affects!&lt;/U&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the answer is likely to truncate "user_role" first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use a tDBRow prior to the subjob you outlined. Add a truncate query to the tDBRow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;TRUNCATE user_role...&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.postgresql.org/docs/9.1/sql-truncate.html" alt="https://www.postgresql.org/docs/9.1/sql-truncate.html" target="_blank"&gt;https://www.postgresql.org/docs/9.1/sql-truncate.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your flow would look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;tDBRow --&amp;gt; On Subjob OK --&amp;gt; &lt;/B&gt;tDBInput(MySQL) --&amp;gt; tFileOutputDelimited --&amp;gt; tMap --&amp;gt; tDBOutput --&amp;gt; tLogRow&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jan 2021 19:54:51 GMT</pubDate>
    <dc:creator>PaulyWally</dc:creator>
    <dc:date>2021-01-28T19:54:51Z</dc:date>
    <item>
      <title>Truncate &lt;...&gt; cascade</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Truncate-lt-gt-cascade/m-p/2321496#M91522</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;first I will describe what I want to achieve.&lt;/P&gt;&lt;P&gt;We are migrating from MySQL db to PostgreSQL db. I need to truncate PostgreSQL table(s) with all sequences and than add new data from MySQL and restore the sequences. If I'm running a classic job:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tDBInput(MySQL)--&amp;gt;tFileOutputDelimited--&amp;gt;tMap--&amp;gt;tDBOutput--&amp;gt;tLogRow&lt;/P&gt;&lt;P&gt;Where in output I select Truncate and Inser&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;than this Error appears:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exception in component tDBOutput_1 (UsersCSV)&lt;/P&gt;&lt;P&gt;org.postgresql.util.PSQLException: ERROR: cannot truncate a table referenced in a foreign key constraint&lt;/P&gt;&lt;P&gt;Detail: Table "user_role" references "users".&lt;/P&gt;&lt;P&gt;Hint: Truncate table "user_role" at the same time, or use TRUNCATE ... CASCADE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I implement Truncante &amp;lt;...&amp;gt; Cascade for this or any other solution to solve this.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:44:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Truncate-lt-gt-cascade/m-p/2321496#M91522</guid>
      <dc:creator>Pasha23</dc:creator>
      <dc:date>2024-11-16T00:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Truncate &lt;...&gt; cascade</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Truncate-lt-gt-cascade/m-p/2321497#M91523</link>
      <description>&lt;P&gt;Can you truncate "user_role"? I assume you can since you are truncating "user". Since there's a referential constraint, any records left in "user_role" would likely be pointless.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;I&gt;&lt;U&gt;I am completely speculating based on the little info you gave me! Please ensure truncating "user_role" would not cause any adverse affects!&lt;/U&gt;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the answer is likely to truncate "user_role" first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use a tDBRow prior to the subjob you outlined. Add a truncate query to the tDBRow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;TRUNCATE user_role...&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.postgresql.org/docs/9.1/sql-truncate.html" alt="https://www.postgresql.org/docs/9.1/sql-truncate.html" target="_blank"&gt;https://www.postgresql.org/docs/9.1/sql-truncate.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your flow would look like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;tDBRow --&amp;gt; On Subjob OK --&amp;gt; &lt;/B&gt;tDBInput(MySQL) --&amp;gt; tFileOutputDelimited --&amp;gt; tMap --&amp;gt; tDBOutput --&amp;gt; tLogRow&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 19:54:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Truncate-lt-gt-cascade/m-p/2321497#M91523</guid>
      <dc:creator>PaulyWally</dc:creator>
      <dc:date>2021-01-28T19:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Truncate &lt;...&gt; cascade</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Truncate-lt-gt-cascade/m-p/2321498#M91524</link>
      <description>&lt;P&gt;PaulyWally,&lt;/P&gt;&lt;P&gt;thank you.&lt;/P&gt;&lt;P&gt;I'll try it...&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 08:43:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Truncate-lt-gt-cascade/m-p/2321498#M91524</guid>
      <dc:creator>Pasha23</dc:creator>
      <dc:date>2021-01-29T08:43:56Z</dc:date>
    </item>
  </channel>
</rss>

