MERGE INTO aemstudent aut USING (
SELECT 1 ,
alias,
birthdate, s
ocial_sec, birthplace, citizenship, civility, first_name, lastname, maiden_name, marital_stat, middle_name, national_id, other_id, sex
from ae6contact where contact_id = @cid and client = @client) ct on (aut.student_pk = @cle and aut.client = @client)
when matched then
update set aut.alias_name = ct.alias, aut.birth_date = ct.birthdate, aut.social_sec = ct.social_sec, aut.birth_place = ct.birthplace, aut.country_origin = ct.citizenship, aut.name_title = ct.civility, aut.first_name = ct.first_name, aut.surname = ct.lastname, aut.maiden_name = ct.maiden_name, aut.sivil_status = ct.marital_stat, aut.middle_name = ct.middle_name, aut.national_id = ct.national_id, aut.other_id_no = ct.other_id, aut.sex = ct.sex
Partager