Error while running tpt : Temporary table not allowed in statement.

Database
Enthusiast

Error while running tpt : Temporary table not allowed in statement.

Hello Gurus,

I am using insert to gbltmp table first in tpt script and then trying to run export.

STEP INSERTS

(

APPLY

('INSERT into EDWGBLTMP.GBL_PRTY_AGNT_SUB_CHNNL_HIST      

  SELECT              

       pasc.prty_id

      ,pasc.chnl_id AS sub_chnl_id

        FROM      EDWFINVIEWS.prty_agnt_sub_chnl_hist pasc,

                           (SEL prty_agnt_id 

                             FROM EDWfinviews.subsrptn_actvt_hist sah

                             group by 1) v_sah

        WHERE  pasc.prty_agnt_sub_chnl_end_dt = ''9999-12-31''

        and v_sah.prty_agnt_id = pasc.prty_id;')

,('collect stats on temporary EDWGBLTMP.GBL_PRTY_AGNT_SUB_CHNNL_HIST  column prty_id  ;')

TO OPERATOR (DDL_OPERATOR );


   DEFINE OPERATOR EXPORT_OPERATOR()

   DESCRIPTION 'TERADATA PARALLEL TRANSPORTER EXPORT OPERATOR'

   TYPE EXPORT

.....

select

.... 

something ...XYZ

..

LEFT OUTER JOIN EDWGBLTMP.GBL_prty_agnt_sub_chnnl_hist psub

      ON j.prty_agnt_id = psub.prty_id 

Getting error : 

RDBMS error 5332: Temporary table 'GBL_prty_agnt_sub_chnnl_hist' not allowed in statement.

Any suggestions how to overcome this, please?

Thanks.