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