Archives of the TeradataForum
Message Posted: Fri, 10 May 2002 @ 12:32:37 GMT
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 ')'.
|