同时执行多条SQL语句

BEGIN
  DELETE FROM SYSROLEOPENR WHERE ROLEID = 2;
  INSERT INTO SYSROLEOPENR
    (PKID, ROLEID, OPERID)
    SELECT SYSROLEOPENR_PKID_SEQ.NEXTVAL, '2' ROLEID, OPERID
      FROM SYSMODULEOPER
     WHERE OPERCODE = '300090010';
  INSERT INTO SYSROLEOPENR
    (PKID, ROLEID, OPERID)
    SELECT SYSROLEOPENR_PKID_SEQ.NEXTVAL, '2' ROLEID, OPERID
      FROM SYSMODULEOPER
     WHERE OPERCODE = '300090020';
  INSERT INTO SYSROLEOPENR
    (PKID, ROLEID, OPERID)
    SELECT SYSROLEOPENR_PKID_SEQ.NEXTVAL, '2' ROLEID, OPERID
      FROM SYSMODULEOPER
     WHERE OPERCODE = '300090050';

END;

posted @ 2013-03-14 16:44  Mr zhao  阅读(2063)  评论(0编辑  收藏  举报