Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Fri, 10 May 2002 @ 12:32:37 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Where clause in insert macro
 
From:   Anomy Anom

<-- Anonymously Posted: Friday, May 10, 2002 08:14 -->

What I an trying to accomplish:

I have a macro A_KFM043 to insert a row into a table. Then I was calling the macro R_KFM043 to insert a row into another table only if the conditions of my where clause are met.

I was using triggers, but this was causing table level locking, so I had to drop the triggers.

I tried the where clause in the calling macro and it also failed.

/* condensed version */
replace macro a_kfm043
   (
      fac_terma         (char(11)),
      fac_termz         (char(11))
   )
as (
          /*  facsect insert        */
      insert into facsect
       (fac_terma, fac_termz)
      values
       (:fac_terma, :fac_termz);
          /*  facsect2 insert       */
      select 'begref';
       exec r_kfm043 (:fac_terma, :fac_termz)
        where fac_terma like ('%KZZ')or fac_termz like ('%KZZ');
      select 'endref';
   );
                                                          $
*** Failure 3706 Syntax error: Did not expect 'where' that follows the ')'.


     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020