同时执行多条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;

转载于:https://www.cnblogs.com/qq1040991197/archive/2013/03/14/2959636.html

你可能感兴趣的:(同时执行多条SQL语句)