Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

using Merge Statment to insert/update in same table

mmoayedFeb 15 2019 — edited Feb 20 2019

Hello everyone,
I have developed two processes one called Email and one called Orders  each one is using Merge statment and they Insert/update to same table . At the beginning I scheduled these two processes in serious and everything went good. When I tried to make execution for the schedule paralleled, I noticed that the processes was stopped and other processes in ODI not completed.

From your experience, What can I do or add to Merge  Statement to make process work properly even if they are working at the same time.

I am using the  same concept in this SQL:

merge into tak_ne a

using (select  NAME , count(*)  Count_ST

       from    tak_beb

   group by DEPT_NAME

   )b

ON (a.NAME=b.NAME)

When matched then

   Update

   Set a.NAME = b.NAME

       a.count = b.count_ST

       a.MODEL = 0

   a.Process_Time = 380

When not matched then

insert

(

Name,

count,

Model

Process_Time

)

Values

(

b.NAME

b.count_ST

0

380

)

One SQL in Process Email and one in Order Process after compelteing the process for each one I am using in ODI task to insert Sequences ID in Table tak_ne.

Your fast reply is appreciated ,
Mohammed

Comments
Post Details
Added on Feb 15 2019
13 comments
3,505 views