저장 프로세스와 순환 교체

1412 단어 저장 프로세스
create or replace procedure exam_temp_produce
as
CURSOR lib_ids IS select ss.dir_id,ss.dir_site_id from directorys ss where ss.dir_name = '    ';

BEGIN
    --   、  、  
    FOR A IN lib_ids LOOP
    insert into directorys(dir_id,dir_site_id,dir_parent_id,dir_name,dir_desc,dir_is_avail,dir_start_time,dir_end_time,dir_create_time,dir_create_user,dir_update_time,dir_update_user,dir_sort)
    values(directorys_seq.nextval,A.dir_site_id,A.dir_id,'   ','   ','Y',sysdate,sysdate,sysdate,2,sysdate,2,1);
    insert into directorys(dir_id,dir_site_id,dir_parent_id,dir_name,dir_desc,dir_is_avail,dir_start_time,dir_end_time,dir_create_time,dir_create_user,dir_update_time,dir_update_user,dir_sort)
    values(directorys_seq.nextval,A.dir_site_id,A.dir_id,'  ','  ','Y',sysdate,sysdate,sysdate,2,sysdate,2,2);
    insert into directorys(dir_id,dir_site_id,dir_parent_id,dir_name,dir_desc,dir_is_avail,dir_start_time,dir_end_time,dir_create_time,dir_create_user,dir_update_time,dir_update_user,dir_sort)
    values(directorys_seq.nextval,A.dir_site_id,A.dir_id,'  ','  ','Y',sysdate,sysdate,sysdate,2,sysdate,2,3); 
    END LOOP;
  COMMIT;

  EXCEPTION WHEN OTHERS THEN
    ROLLBACK;

END exam_temp_produce;

좋은 웹페이지 즐겨찾기