Page 1 of 1

how to access DB2 Counts in a job

Posted: Thu Nov 05, 2009 12:06 pm
by Sreedhar
Hello,

I have a job where I am loading data from a flat file to a database.

Flat file -> Transformer -> Db2 API Stage

I know that there are 100 records in the flat file. Now I want to know how many of them are inserted into the DB2 Tables?

I can get that by saying select (*) from db2.table, but how can I do a comparision between the flat file content to that of Db2 count? Is there a way in which I can accesss Db2 counts with in the same job?

Regards,

Posted: Thu Nov 05, 2009 2:17 pm
by ray.wurlod
No.

DataStage will tell you how many rows it sent to DB2, and can capture any that were rejected (which you could also count and perform arithmetic).

But the only way you can reliably determine what's in a table is to query the table.

If your records include a run identifier or last updated timestamp, you can constrain your query on that column.

Re: how to access DB2 Counts in a job

Posted: Tue Nov 10, 2009 2:06 pm
by raghu22
You can use the @inrownum function in the transformer and output the result to a flat file or a table