I am using Spring JDBC and Oracle SQL.
using the SpringJDBC class MapSqlParameterSource, I matched the data I want to combine.
Now I want to use the merge operator to update / insert the database table. I have one table and many parameters that I want to combine into it.
merge into proj.person_registry pr
using ( ! parameters should go here somehow? )
on (pr.id = :id or pr.code = :code)
when matched then
update set pr.code = :code,
pr.name = :name,
pr.firstname = :firstname,
pr.cl_gender = :cl_gender,
pr.cl_status = :cl_status,
pr.aadress = :aadress,
pr.aadress_date = :aadress_date
when not matched then
insert values (:code, :name, :firstname, :cl_gender, :cl_status, ;aadress, :aadress_date);
Should I somehow create a temporary table for the keyword using or is there another way? how would i go for a merger like that?
pr.id pr.code. : id null, , , pr.code, : code. , :
update set pr.code = :code,