CREATE OR REPLACE PROCEDURE V8_UPD_LOCATOR_NOTES IS
   CURSOR data_cur  IS
     select wact_description, wact_id from wact,waty,watg where 
       wact_waty_id=waty_id and 
       waty_watg_id=watg_id and 
       watg_role=4 and  
       wact_starttime<=sysdate and
       wact_endtime>=sysdate; 
   data  data_cur%ROWTYPE;
BEGIN
  FOR DATA IN data_cur
   LOOP
    insert into want (want_id, want_notes, want_notes_clob) 
              values (seq_want.nextval, data.wact_description, data.wact_description);
    update wact set wact_want_id=seq_want.currval where wact_id=data.wact_id;
   end loop;
   commit;  
   EXCEPTION
     WHEN NO_DATA_FOUND THEN
       NULL;
     WHEN OTHERS THEN
       NULL;
END V8_UPD_LOCATOR_NOTES;
/

