It is possible to split insert statment & update stament from merge query using java
===

I have a merge query like this

       MERGE INTO dept a
     USING (
         SELECT  50           deptno
              , 'ENGINEERING' dname
              , 'WEXFORD'     loc
         FROM dual
     ) b
     ON (a.deptno = b.deptno)
     WHEN NOT MATCHED THEN
         INSERT VALUES (b.deptno, b.dname, b.loc)
     WHEN MATCHED THEN
         UPDATE SET a.loc = 'WEXFORD, PA';
     I need output  like:
     
     INSERT VALUES (b.deptno,b.dname,b.loc)
    UPDATE SET a.loc='WEXFORD,pA'

Can I achieve this by using substring any another simple way to do this.