Page 1 of 1

Capturing deleted hashed records count

Posted: Thu Apr 15, 2010 4:31 pm
by ASU_ETL_DEV
Hello,
I have a job that deletes hashed file records using a UV stage. I would like to take a count of the records that will be deleted but I do not like the solution of a SELECT COUNT(*) before the DELETE. I would like to know whether there is a way of capturing the count of the deleted records as a result of the same SQL DELETE operation on the hashed file (like the automatic count that is shown at the end of a SQL DELETE against a relational database).
Thanks

Posted: Thu Apr 15, 2010 5:04 pm
by ray.wurlod
DataStage/SQL does report N records deleted when a DELETE statement is executed interactively. Does not this report appear in the job log?

It is not possible to take a count of the records that "will be" deleted without counting beforehand.

DataStage ("UniVerse") tables are relational. You can choose whether or not to enforce first normal form.

Posted: Thu Apr 15, 2010 5:12 pm
by ASU_ETL_DEV
Yes, I have seen that the log does not report a message of the deleted records' count but I had hoped that there might be an option to actually have it report it. That way I could have gotten it from the log instead of running an extra SELECT COUNT(*).
All right, thanks.

Re: Capturing deleted hashed records count

Posted: Thu Apr 15, 2010 9:17 pm
by chulett
ASU_ETL_DEV wrote:(like the automatic count that is shown at the end of a SQL DELETE against a relational database).
For the record, I have yet to use a relational database where a sql delete reported anything back automatically. Some may, but all certainly don't.

Posted: Thu Apr 15, 2010 10:00 pm
by ASU_ETL_DEV
You are right, my mistake.