|
|
Archives of the TeradataForum
Message Posted: Thu, 19 Sep 2002 @ 12:12:49 GMT
Subj: | | Re: Case Statement in Macro |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Thursday, September 19, 2002 07:09 -->
This was the original macro. In V2R3, if a NULL was passed in for ckt_subd_no, the row was deleted. Now in V2R4.1.3, the row is not
deleted. So I am trying to check the value of ckt_subd_no to see if it is NULL to determine which delete statement I should use. So I was
trying to use CASE statement. I think Glen's suggestion might erroneously delete data. I might have 2 rows - 1 where ckt_subd_no is NULL
and 1 where ckt_subd_no is populated. I only want to delete the row where ckt_subd_no is NULL.
REPLACE MACRO a_tb0003
( ni_cktid (INT), ckt_subd_no (INT),
ckt_date (CHAR(8)), ckt_time (INT)
)
AS
(
DELETE TGOPWKLSTV1
WHERE NI_CKTID = :ni_cktid AND CKT_SUBD_NO = :ckt_subd_no
AND CKT_DATE = :ckt_date AND CKT_TIME = :ckt_time;
);
| |