写个plsql 代码块,把insert语句包起来就可以了,参考:
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;
1、将你要执行的sql语句写入一个txt文件中; 2、修改文件后缀为.sql文件; 3、使用 “source + 路径+文件名” 注:source与路径之间有空格。
写sql脚本,原后@那个脚本就行了!