Page 1 of 1

Deleting nothing in an ODBC stage

Posted: Thu Sep 09, 2004 2:04 pm
by KeithM
Datestage will issue a warning message saying 'zero rows updated' if I use an ODBC stage to do updates and the key being updated doesn't exist in the table.

I expected this same behavior when doing deletes. I used an ODBC stage and changed the SQL to user defined so that I could issue a delete statement. When I run the job Datastage does not issue the warning message if the statement deletes zero rows. Is there any way to change this so that deleting nothing isn't treated as a success?

Posted: Tue Sep 14, 2004 1:27 pm
by roy
Hi,
I'm not aware of a way to do it,
but in any case if you want to know are there any rows to be deleted you could perform a select count with the same where part you use in the delete statement.
I guess since you intend to delete the rows anyway there is nothing wrong with them not being there in the first place, the same can not be said when you issue an update statement.

IHTH,