Skip to Main Content

Java Development Tools

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!

How to use "MERGE" function on Business Components (ADF 12.2.1)

LCabacoMar 16 2016 — edited Mar 17 2016

Hello guys,

I'm using business components, and i can't figure out how to create a VO query with the merge function.

What i need is that my query identify if the record exists. In case it exists, it does an update. Otherway it will create a new record.

This is my query:

MERGE INTO privileges D

USING (SELECT :vType "TYPE",

  :vUserKey USERKEY,

  :vFeatureKey FEATUREKEY

  FROM dual) S

ON (D.type = s.type

  AND D.userkey = s.userkey

  AND D.FEATUREKEY = s.FEATUREKEY)

WHEN MATCHED THEN UPDATE SET  D."VIEW" = :vPrivView,

                              D.CREATEEDIT = :vPrivCreateEdit,

                              D."DELETE" = :vPrivDelete 

WHEN NOT MATCHED THEN INSERT (recid, "TYPE", userkey, featurekey,

                              "VIEW", createedit, "DELETE")

                      VALUES (:vType ||''||:vUserKey ||''||:vFeatureKey, :vType, :vUserKey, :vFeatureKey,

                              :vPrivView,:vPrivCreateEdit,:vPrivDelete);  -- // First argument as ID

How can i use this with Business Components?

Best regards,

Luís Cabaço

This post has been answered by Ajay Taneja on Mar 16 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 14 2016
Added on Mar 16 2016
3 comments
434 views