From: Hardy on
if I'm using the MERGE and want to return how many rows are updated
and how many rows are inserted, the way of get-diagnotics/select-
changed-table doesn't work. A direct way is just to split the
statement to update and insert, return the affected count. or just
use merge, and use the predicate to test the affected count.

is there any good way to do that? or Merge just not a good choice
here?

Thanks.
From: Hardy on
On Aug 10, 1:15 am, Serge Rielau <srie...(a)ca.ibm.com> wrote:
> On 8/10/2010 3:18 AM, Hardy wrote:> if I'm using the MERGE and want to return how many rows are updated
> > and how many rows are inserted, the way of get-diagnotics/select-
> > changed-table doesn't work.  A direct way is just to split the
> > statement to update and insert, return the affected count.  or just
> > use merge, and use the predicate to test the affected count.
>
> > is there any good way to do that? or Merge just not a good choice
> > here?
>
> > Thanks.
>
> Are you saying you want the "ratio" of INSERT vs UPDATE vs DELETE?
> I can't think of any easy way. That's where SELECT FROM MERGE would come
> in handy....some day,...
>
> --
> Serge Rielau
> SQL Architect DB2 for LUW
> IBM Toronto Lab

Thank you, Serge;)