/**
* * Name: Modify single, QC Sync trigger
* * Function: Modify the single modified, QC information synchronization to provide the foreground display
**created by FANQD @ 2010/12/26
**/
Create or Replace Trigger MODIFYSYNCHRONIZEQC
After update on tb_support_modify
Referencing old as old new as NewValue
For each row
Declare
VAR_OUT1 VARCHAR (255);
Var_out2 VARCHAR (255);
BEGIN
SELECT u.objname into var_out1 from Tb_support_userinfo u WHERE u.objno=:newvalue.modifier;
SELECT v.module_names into Var_out2 from vw_modify_active v WHERE v.modify_id=:newvalue.modify_id;
UPDATE default_ Quality Policy Import Test _. req@qc114 T
SET t.rq_user_25 = ' Modify Reason: ' | |:newvalue.modify_reason| | ' /n Modification Note: ' | |:newvalue.modify_desc| | ' /n Modify file and path: ' | |:newvalue.modify_file| |:newvalue.program_path| | ' /n Modify table structure information: ' | |:newvalue.table_modify
,--Modify information
T.rq_user_26 =: Newvalue.self_test_desc,--unit Test record
t.rq_user_27 = ' Test Essentials and Recommendations: ' | |:newvalue.test_suggestion| | ' /n Online steps: ' | |:newvalue.publish_desc,
--Test points and on-line steps
T.rq_req_type = Decode (: newvalue.test_type,1, ' field test ', ' Test room test '),
T.rq_user_04 = VAR_OUT1,--Modified person
t.rq_user_01 = var_out2--Module
WHERE t.rq_user_23 =: newvalue.product_id
and t.rq_user_22 =: newvalue.modify_num;
End Modifysynchronizeqc;
When executing the error, the following:
ORA-04091: Table xx has changed, the trigger/function cannot read it
Problem Reason:
In the process: newvalue.modify_id again to check the target table, this action is considered illegal by Oracle.
The record row of the target table is updated without having to query the target record line by ID. This action was considered illegal by Oracle.
/**
* * Name: Modify single, QC Sync trigger
* * Function: Modify the single modified, QC information synchronization to provide the foreground display
**created by FANQD @ 2010/12/26
**/
Create or Replace Trigger MODIFYSYNCHRONIZEQC
After update on tb_support_modify
Referencing old as old new as NewValue
For each row
Declare
VAR_OUT1 VARCHAR (255);
Var_out2 VARCHAR (255);
BEGIN
SELECT u.objname into var_out1 from Tb_support_userinfo u WHERE u.objno=:newvalue.modifier;
SELECT Wmsys. Wm_concat (V.module_name) into the var_out2 from Tb_support_module v WHERE v.parent_id=:newvalue.modify_id;
UPDATE default_ Quality Policy Import Test _. req@qc114 T
SET t.rq_user_25 = ' Modify Reason: ' | |:newvalue.modify_reason| | ' /n Modification Note: ' | |:newvalue.modify_desc| | ' /n Modify file and path: ' | |:newvalue.modify_file| |:newvalue.program_path| | ' /n Modify table structure information: ' | |:newvalue.table_modify,--Modify information
T.rq_user_26 =: Newvalue.self_test_desc,--unit Test record
t.rq_user_27 = ' Test Essentials and Recommendations: ' | |:newvalue.test_suggestion| | ' /n Online steps: ' | |:newvalue.publish_desc,
--Test points and on-line steps
T.rq_req_type = Decode (: newvalue.test_type,1, ' field test ', ' Test room test '),
T.rq_user_04 = VAR_OUT1,--Modified person
t.rq_user_01 = var_out2--Module
WHERE t.rq_user_23 =: newvalue.product_id
and t.rq_user_22 =: newvalue.modify_num;
End Modifysynchronizeqc;