AFTER the DELETE OR INSERT OR UPDATE ON CAD_0
FOR EACH ROW
Declare VY_DRAWING_ID CHAR (38). VCAD_ID1 VARCHAR2 (32). VDRAWING_CODE VARCHAR2 (30); VDRAWING_NAME VARCHAR2 (100); VDRAWING_SPECIFICATION VARCHAR2 (2000);
VDRAWING_DESC VARCHAR2 (2000); VBI_FILE_ID VARCHAR2 (30); VFILE_ID VARCHAR2 (32). VFILE_NAME VARCHAR2 (100); VFILE_FILEPATH VARCHAR2 (2000); VFILE_SIZE NUMBER; VREMARK VARCHAR2 (2000);
PRAGMA AUTONOMOUS_TRANSACTION;
The BEGIN
- add or update
If inserting or updating then
VCAD_ID1:=: NEW. GUID; VDRAWING_CODE:=: NEW. ID; VDRAWING_NAME:=: NEW. NAME; VDRAWING_DESC:=: NEW. F_000109;
VY_DRAWING_ID:=(sys_guid ();
VY_DRAWING_ID:=substr (VY_DRAWING_ID, 0, 8) | | '-' | | substr (VY_DRAWING_ID, 9, 4) | | '-' | | substr (VY_DRAWING_ID, 13, 4) | | '-' | | substr (VY_DRAWING_ID, 17, 4) | | '-' | | substr (VY_DRAWING_ID, 21, 12);
New
-If inserting then
INSERT into Y_DRAWING @ E10database (Y_DRAWING_ID CAD_ID, DRAWING_CODE, DRAWING_NAME, DRAWING_SPECIFICATION, DRAWING_DESC, REMARK, BI_FILE_ID, FILE_ID, FILE_NAME, FILE_FILEPATH, FILE_SIZE, "ApproveStatus")
Values (VY_DRAWING_ID VCAD_ID1, VDRAWING_CODE VDRAWING_NAME, ' ', VDRAWING_DESC, ' ', ', ', ', ', 0, 'Y');
- update
The else
The SELECT C1 F_000087, C1. F_000001 INTO VDRAWING_SPECIFICATION, VREMARK FROM CAD_1 C1 WHERE C1. FOUNDATIONFK=: NEW. GUID;
IF: NEW FILEGUID IS NOT NULL THEN
SELECT BF GUID, BF. ID, BF. NAME, BF. FILEPATH, BF. The FILESIZE INTO VBI_FILE_ID, VFILE_ID, VFILE_NAME, VFILE_FILEPATH, VFILE_SIZE FROM BI_FILE BF WHERE BF. The GUID=: NEW. FILEGUID;
END IF;
The UPDATE Y_DRAWING @ E10database Y SET Y.D RAWING_NAME=VDRAWING_NAME,
Y.D RAWING_SPECIFICATION=VDRAWING_SPECIFICATION,
Y.D RAWING_DESC=VDRAWING_DESC,
REMARK=VREMARK,
Y.B I_FILE_ID=VBI_FILE_ID,
Y.F ILE_ID=VFILE_ID,
Y.F ILE_NAME=VFILE_NAME,
Y.F ILE_FILEPATH=VFILE_FILEPATH,
Y.F ILE_SIZE=VFILE_SIZE
WHERE Y.C AD_ID=VCAD_ID1;
end if;
- delete
The else
VCAD_ID1:=: old. GUID;
The DELETE FROM Y_DRAWING @ E10database Y WHERE Y.C AD_ID=VCAD_ID1;
end if;
commit;
END;
Above the trigger is, when INSERT, UPDATE, DELETE, trigger connection SQL SERVICE to do the corresponding operation, when the INSERT when the UPDATE, DELETE an error: ORACLE ORA - 02070: database E10DATABASE tired SYS_OP_C2C in this context; A long day couldn't find a solution? To solve, thank!!
CodePudding user response:
Oneself the top