| Archives of the TeradataForumMessage Posted: Fri, 10 May 2002 @ 12:59:21 GMT
 
 
  
| Subj: |  | Re: Where clause in insert macro |  |  |  | From: |  | Geoffrey Rommel |  
 |  | 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. |  | 
 
 
 
 The trigger seems like a good idea, and you should be able to use "locking row for write", but I'll take your word for it that it
doesn't work. The condition in this case is a LIKE test on the input parameters.  For this you will need to use a stored procedure. It would look
something like this (untested!): 
/*  facsect insert        */
insert into facsect
 (fac_terma, fac_termz)
values
 (:fac_terma, :fac_termz);
/*  facsect2 insert       */
if fac_terma like '%KZZ' or fac_termz like '%KZZ' then
   exec r_kfm043 (:fac_terma, :fac_termz);  /* or bring that code in line
here */
endif;
 
 --wgr 
 
 |