<?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 teradata stored procedure in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/teradata-stored-procedure/m-p/2374383#M136986</link>
    <description>I am a teradata DBA and our talend developers are having an issue when executing a SPROC.&amp;nbsp; As any teradata person knows when a tptload job fails the target table becomes locked.&amp;nbsp; i have written a SPROC which does the following 
&lt;BR /&gt;&amp;nbsp; SET Stmt = 'CREATE TABLE "iUTL' || '"."' ||&amp;nbsp; TRIM(StgTable) || '_temp" AS (SEL * FROM "iSTG_T"."' || TRIM(stgtable) || '") WITH DATA;'; 
&lt;BR /&gt;&amp;nbsp; EXECUTE IMMEDIATE Stmt; 
&lt;BR /&gt;i have a continue handler for this statement if a a SQL return code is return which states istg_t.stgtable is loading. 
&lt;BR /&gt;if it is loading i do the following. 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET Stmt =&amp;nbsp; 'create table "iSTG_T"."' || TRIM(StgTable) || '_new" as "iSTG_T"."' || TRIM(StgTable) ||&amp;nbsp; '" WITH NO DATA AND STATISTICS;' ; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXECUTE IMMEDIATE Stmt; 
&lt;BR /&gt;&amp;nbsp; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET Stmt =&amp;nbsp; 'drop table "iSTG_T"."' || TRIM(StgTable) ||'";'; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXECUTE IMMEDIATE Stmt; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET Stmt = 'RENAME TABLE' || '"iSTG_T"."' ||TRIM(STGTABLE) ||'_new" TO "iSTG_T"."' || TRIM(StgTable) ||'";' ; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXECUTE IMMEDIATE Stmt; 
&lt;BR /&gt; 
&lt;BR /&gt;everything works as expected.&amp;nbsp; a new table is created and the old one dropped and the tptloads successfully.&amp;nbsp; after the tpt there are several other SPROCS that do updates/inserts etc... 
&lt;BR /&gt;the problem is that these other procs after the tpt are not committing.&amp;nbsp; looking in the teradata log, all steps are executed successfully however when the job is complete the data is not updated. 
&lt;BR /&gt;if this step is removed from the talend job or the table is not in a load status (the procs drops the _temp table created and exits).&amp;nbsp; everything works fine. 
&lt;BR /&gt;any ideas or thoughts would be much appreciated.</description>
    <pubDate>Sat, 16 Nov 2024 10:27:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T10:27:38Z</dc:date>
    <item>
      <title>teradata stored procedure</title>
      <link>https://community.qlik.com/t5/Talend-Studio/teradata-stored-procedure/m-p/2374383#M136986</link>
      <description>I am a teradata DBA and our talend developers are having an issue when executing a SPROC.&amp;nbsp; As any teradata person knows when a tptload job fails the target table becomes locked.&amp;nbsp; i have written a SPROC which does the following 
&lt;BR /&gt;&amp;nbsp; SET Stmt = 'CREATE TABLE "iUTL' || '"."' ||&amp;nbsp; TRIM(StgTable) || '_temp" AS (SEL * FROM "iSTG_T"."' || TRIM(stgtable) || '") WITH DATA;'; 
&lt;BR /&gt;&amp;nbsp; EXECUTE IMMEDIATE Stmt; 
&lt;BR /&gt;i have a continue handler for this statement if a a SQL return code is return which states istg_t.stgtable is loading. 
&lt;BR /&gt;if it is loading i do the following. 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET Stmt =&amp;nbsp; 'create table "iSTG_T"."' || TRIM(StgTable) || '_new" as "iSTG_T"."' || TRIM(StgTable) ||&amp;nbsp; '" WITH NO DATA AND STATISTICS;' ; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXECUTE IMMEDIATE Stmt; 
&lt;BR /&gt;&amp;nbsp; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET Stmt =&amp;nbsp; 'drop table "iSTG_T"."' || TRIM(StgTable) ||'";'; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXECUTE IMMEDIATE Stmt; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET Stmt = 'RENAME TABLE' || '"iSTG_T"."' ||TRIM(STGTABLE) ||'_new" TO "iSTG_T"."' || TRIM(StgTable) ||'";' ; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXECUTE IMMEDIATE Stmt; 
&lt;BR /&gt; 
&lt;BR /&gt;everything works as expected.&amp;nbsp; a new table is created and the old one dropped and the tptloads successfully.&amp;nbsp; after the tpt there are several other SPROCS that do updates/inserts etc... 
&lt;BR /&gt;the problem is that these other procs after the tpt are not committing.&amp;nbsp; looking in the teradata log, all steps are executed successfully however when the job is complete the data is not updated. 
&lt;BR /&gt;if this step is removed from the talend job or the table is not in a load status (the procs drops the _temp table created and exits).&amp;nbsp; everything works fine. 
&lt;BR /&gt;any ideas or thoughts would be much appreciated.</description>
      <pubDate>Sat, 16 Nov 2024 10:27:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/teradata-stored-procedure/m-p/2374383#M136986</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T10:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: teradata stored procedure</title>
      <link>https://community.qlik.com/t5/Talend-Studio/teradata-stored-procedure/m-p/2374384#M136987</link>
      <description>Hi,
&lt;BR /&gt;Could you please post your job setting screenshots into forum which will be helpful for us to address your issue?
&lt;BR /&gt;Best regards
&lt;BR /&gt;Sabrina</description>
      <pubDate>Wed, 17 Aug 2016 07:36:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/teradata-stored-procedure/m-p/2374384#M136987</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-17T07:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: teradata stored procedure</title>
      <link>https://community.qlik.com/t5/Talend-Studio/teradata-stored-procedure/m-p/2374385#M136988</link>
      <description>Thanks Sabrina.&amp;nbsp; I am not a Talend guy.&amp;nbsp; i have forwarded your request to our talend team.&lt;BR /&gt;do you have and sample screen shots you are looking for?&amp;nbsp; that might make it easier to get you the right thing the quickest.</description>
      <pubDate>Thu, 18 Aug 2016 16:40:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/teradata-stored-procedure/m-p/2374385#M136988</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-18T16:40:36Z</dc:date>
    </item>
  </channel>
</rss>

