Deleting nothing in an ODBC stage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
KeithM
Participant
Posts: 61
Joined: Thu Apr 22, 2004 11:34 am
Contact:

Deleting nothing in an ODBC stage

Post 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?
Keith
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post 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,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
Post Reply