Skip to Main Content

APEX

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!

Merge statement for a form on a view

user-z52q7May 21 2023

Hi there,

I have the following view and I would like to update and insert on it via a form and page processing:

SELECT

HUB_ROLE_EDIT."ID_FINAL" as "ID1",

HUB_ROLE_EDIT.ASSIGNEE,

ALT_SAP_PROJECTROLES."ID_Final" as "ID2",

ALT_SAP_PROJECTROLES.DEF_ROLE,

ALT_SAP_PROJECTROLES.DEF_ROLE_OWNER,

ALT_SAP_PROJECTROLES.DEF_PRIO,

ALT_SAP_PROJECTROLES.SAP_ROLE_ASSIGNEE,

ALT_SAP_PROJECTROLES.SAP_ROLE_ASSIGNEE_EMAIL,

ALT_SAP_PROJECTROLES.SAP_B_NO,

ALT_SAP_PROJECTROLES.SAP_ROLES_B_NO

FROM ALT_SAP_PROJECTROLES

LEFT JOIN HUB_ROLE_EDIT on ALT_SAP_PROJECTROLES."ID_Final" = HUB_ROLE_EDIT."ID_FINAL"

I tried it with the follwing merge statement in the process but it doesn't take the values when I update or insert and I do not get any error massage.

merge into HUB_ROLE_EDIT x

using (SELECT null from dual) e

on (x.ID_FINAL = :P25_ID2)

when matched then

update set

x.ASSIGNEE = :P25_ASSIGNEE

when not matched then

insert (x.ID_FINAL, x.ASSIGNEE) values (:P25_ID2, :P25_ASSIGNEE);

the same happens with this merge statment:

merge into HUB_ROLE_EDIT x

using (SELECT :P25_ID2 as ID, :P25_ASSIGNEE as NAME from dual) e

on (x.ID_FINAL = e.ID)

when matched then

update set

x.ASSIGNEE = e.NAME

when not matched then

insert (x.ID_FINAL, x.ASSIGNEE) values (e.ID, e.NAME);

Anyone an idea what I do wrong?

Thank you so much in advance and regards

Stefanie

Comments
Post Details
Added on May 21 2023
3 comments
328 views