sql - ora-38104columns referenced in on clause cannot be updated -


I have a trigger in which I am using the merge clause, there is no error in the trigger, but when entering a It is done on the table after which the trigger insert is throwing on the statement being activated. The emp_id column referenced on the Ora-38104 columns section

can not be updated here. Merge Statement

 < Code> Merge is Stg_ta_payroll USING (Select: NEW.ID_TM_ENR ID_TM_ENR, to_number (: NEW.ID_STR_RT) ID_STR_RT,: NEW.ID_EM ID_EM, nvl (TO_NUMBER (TO_CHAR (: NEW.TS_EM_TM_IN, ' YYMMDD '), 0) V_TA_DATE, V_SESSION_NO V_SESSION_NO ,: NEW.TS_EM_TM_IN TS_EM_TM_IN ,: NEW.TS_EM_TM_OUT TS_EM_TM_OUT, to decode (NEW.TY_TM,' 0 ', NVL (TO_CHAR (NEW.TS_EM_TM_IN,' HH24MI '), '0000'), '') V_TIME_IN, to decode (New: TY_TM, '0', NVL (TO_CHAR (NEW.TS_EM_TM_OUT, 'HH24MI'), '0000'), '') V_TIME_OUT, V_MGR_OVRD V_MGR_OVRD ,: NEW.ID_MGR ID_MGR, to decode (NEW.Ty_TM, 'xx', '9',: NEW.TY_TM) TY_TM, Decoded (NEW.TY_TM, '0' ,: NEW.OTHER_HRS_STR, (NVL ((: (OLD.OTHER_HRS_STR), 0) + Anviel ((NEW.OTHER_HRS_STR), 0))) OTHER_HRS_STR, - V_OTHER_HRS_STR V_OTHER_HRS_STR, V_AREA V_AREA, V_ASSC_NAME V_ASSC_NAME, V_MISC_WAGES_DESC V_MISC_WAGES_DESC, V_SHRT_STR_NAME V_SHRT_STR_NAME, (: NEW .HRS_STR +: NEW.OTHER_HRS_STR) Dual to TOT_HRS) at STG (TIME_ENT_ID = STG.ID_TM_ENR and to_number (STR_ID) = to_number (STG.ID_STR_RT) and EMP_ID = STG.ID_EM) when Set date update update status = null, EMP_ID = STG.ID_EM, TA_DATE = STG.V_TA_DATE, --SESSION_NO = STG.V_SESSION_NO, TIME_IN = STG.V_TIME_IN, TIME_OUT = STG.V_TIME_OUT, MGR_OVERRIDE = STG.V_MGR_OVRD, MGR_EMP_NO = STG .ID_MGR, MISC_WAGES_CODE = STG.TW_TM, MISC_WAGES_HRS = STG.OTHER_HRS_STR, area = STG.V_AREA, ASSOCIATE_NAME = STG.V_ASSC_NAME, MISC_WAGES_DESC = STG.V_MISC_WAGES_DESC, SHRT_STR_NAME = STG.V_SHRT_STR_NAME, HRS = STG.TOWT_HRS, STG_OSB_PROCESS_DATE = ZERO  

Your ON section in and EMP_ID = STG .ID_EM is included, and you receive a match, you are setting them EMP_ID = STG.ID_EM , which No effect. You already know that two values ​​are the same, so there is no point in setting the column in the current value. Usually this is just wasted, but here it is causing the ORA-38104 error, because you can not set anything to any ON clause column, even myself .

Just delete it is part of the SET , because it is nothing other than generating error.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -