create or replace procedure fakeData
as
i_full_name varchar2(20);
v_id varchar2(50);
v_t date;
v_uid varchar2(32);
cursor get_id is
select id from itsm4.itsm_problem
where state_id='prb_State_008' and
category in (select id from itsm4.itsm_category where catalog like '6218%' and del='0');
cursor get_t is
select to_date(max(create_time),'yyyy-mm-dd hh24:mi:ss') from itsm4.itsm_work_log where object_id=v_id;
begin
i_full_name:='...';
select id into v_uid from itsm4.ITSM_USER where full_name=i_full_name;
open get_id;
fetch get_id into v_id;
WHILE get_id%FOUND LOOP
open get_t;
fetch get_t into v_t;
close get_t;
insert into itsm4.ITSM_WORK_LOG(id,object_id,description,creater_id,creater_name,create_time,del)values
(v_id,v_id,'省分复核通过',v_uid,i_full_name,to_char(v_t-0.05/24,'yyyy-mm-dd hh24:mi:ss'),'0');
insert into itsm4.ITSM_ACTOR(instance_id,actor_id,active,actor_level,actor_type,actor_name)
values(v_id,v_uid,0,'5','人员',i_full_name);
commit;
fetch get_id into v_id;
end loop;
close get_id;
commit;
end;