How to get the No of Records Inserted/Updated/Deleted from output of BTEQ if we have collect stats
In My BTEQ I am having below statements in the same order
with out collect stats query my process is running good. Since the output of collect stats is also similar to UPDATE I am getting incorrect output.
Is there anyway I can get the no of records affected by executing the query.
or How we can ignore/supress collect stats records affected.
When running a BTEQ script DML commands always return the number of rows 'affected' by the command.
In your example, the COLLECT STATS will not say how many rows 'affected' - because it is not a DML command.
The INSERT and UPDATE will always return the number of rows 'affected' (i.e. inserted or updated). This information will be available to you regardless of whether you have the 'collect stats' command in there or not.
This is fine if you simply wnat to look at the row counts. If you want to do some processing then that is a bit trickier. You have to write some code which wil parse the BTEQ output (i.e. a text file) and extract the relevant information. BTEQ does not make that information available to you in a file/variable anywhere.