17,134
社区成员
发帖
与我相关
我的任务
分享
create or replace trigger production_trigger
before insert on ezoffice.qtsmt$t3057
for each row
declare
record_id number(20);
work_id number(20);
--
p_tranType char(20);
p_allowSmsRemind char(20);
p_pressDealType char(20);
--
begin
select decode(ezoffice.wf_activity.tranType,null,'0',ezoffice.wf_activity.tranType) into p_tranType from ezoffice.wf_activity;
select decode(ezoffice.wf_activity.allowSmsRemind,null,'0',ezoffice.wf_activity.allowSmsRemind) into p_allowSmsRemind from ezoffice.wf_activity;
select decode(ezoffice.wf_activity.pressDealType,null,'0',ezoffice.wf_activity.pressDealType) into p_pressDealType from ezoffice.wf_activity;
select ezoffice.hibernate_sequence.nextval into record_id from dual;
--record_id应用为QTSMT$T3057_ID的值
:new.QTSMT$T3057_ID:=record_id;
--从这里开始循环.
insert into EZOFFICE.wf_proceedActivity
(WF_ProceedActivity_Id,
wf_activity_id,
activityName,
activityDescription,
activityType,
allowStandFor,
allowCancel,
allowTransition,
participantType,
participantUser,
participantGroup,
participantUserName,
participantUserField,
pressType,
deadLineTime,
pressMotionTime,
activityDocumentation,
activityIcon,
activityBeginEnd,
transactType,
actiCommField,
needPassRound,
passRoundUserType,
passRoundUser,
passRoundUserGroup,
passRoundUserName,
passRoundUserField,
passRoundCommField,
participantRole,
passRoundRole,
activityClass,
activitySubProc,
subProcType,
PARTICIPANTGIVENORG,
PASSROUNDGIVENORG,
commentRange,
DOMAIN_ID,
operbutton,
form_id,
actiCommFieldType,
passRoundCommFieldType,
tranCustomExtent,
tranCustomExtentId
)
select ezoffice.hibernate_sequence.nextval,
wf_activity_id,
activityName,
activityDescription,
activityType,
allowStandFor,
allowCancel,
allowTransition,
participantType,
participantUser,
participantGroup,
participantUserName,
participantUserField,
pressType,
deadLineTime,
pressMotionTime,
activityDocumentation,
activityIcon,
activityBeginEnd,
transactType,
actiCommField,
needPassRound,
passRoundUserType,
passRoundUser,
passRoundUserGroup,
passRoundUserName,
passRoundUserField,
passRoundCommField,
participantRole,
passRoundRole,
activityClass,
activitySubProc,
subProcType,
PARTICIPANTGIVENORG,
PASSROUNDGIVENORG,
commentRange,
domain_id,
operButton,
form_id,
actiCommFieldType,
passRoundCommFieldType,
tranCustomExtent,
tranCustomExtentId
from EZOFFICE.wf_activity
where wf_workflowprocess_id = 32226;
update EZOFFICE.wf_proceedActivity set dealwithsign = 0,
wf_workflowprocess_id = 32226,
employee_id = 6527,
ttable_id = 32174,
trecord_id = record_id;
--到这都是要循环的.
end production_trigger;
while EZOFFICE.wf_activity.wf_workflowprocess_id = 32226 loop
这样用好像是不正确的。要么把EZOFFICE.wf_activity.wf_workflowprocess_id值赋给一个变量,然后再进行判断。
begin
for cur in(select employee_id from hr.employees)
loop
dbms_output.put_line(cur.employee_id);
end loop;
end;