04-09-2009 12:56 PM
Hi experts,
How can I delete a record if a key field is initial.
Is it ok?
delete from t_itab
where field1 eq ' '.
I tried this one also:
delete from t_itab
where field1 is initial.
But is says: The operator IS can only be used in "f IS NULL
04-09-2009 3:44 PM
Hi mrwhite,
Don't use IS operator with INITIAL.
These are the following alternatives.
DELETE from t_tab where connid is null.
or
DELETE from t_tab where connid = space.
or
DELETE from t_tab where connid = ' '.
by
prasad GVK.
04-09-2009 1:01 PM
You can delete for all initial records.
Just check for the condition and say delete.
I guess you are not allowed to write initial in where clause of delete that is why it showed you that error.
Use null and ' ' instead which will work perfectly fine for your requirement.
Regards,
Lalit Mohan Gupta.
04-09-2009 1:07 PM
04-09-2009 1:09 PM
04-09-2009 2:02 PM
Try this:-
Delete from t_itab where field1 is Null.
I hope, it'll work for ur requirement.
Thanks.
Anurag.
04-09-2009 3:44 PM
Hi mrwhite,
Don't use IS operator with INITIAL.
These are the following alternatives.
DELETE from t_tab where connid is null.
or
DELETE from t_tab where connid = space.
or
DELETE from t_tab where connid = ' '.
by
prasad GVK.
04-10-2009 5:15 AM
Hi,
I think all answers say the same thing so mine is no different
Use:
delete from t_itab where field1 is null.
But some word of precaution:
a) Dont use this statement in loop where loop is done on same internal tab t_itab.
Thanks.
06-20-2011 10:54 AM
You can delete for all initial records.
Just check for the condition and say delete.
Is it ok?
delete from t_itab
where field1 eq ' '.
I tried this one also:
delete from t_itab
where field1 is initial.
I guess you are not allowed to write initial in where clause of delete.
Regards,
Lalit Mohan Gupta.