1.创建存储过程
create table tb_objects as select * from dba_objects;
CREATE OR REPLACE PROCEDURE "HXL"."sp_insert_data"
AUTHID DEFINER
AS
/*变量说明部分*/
VARNAME INT;
i int;
BEGIN
/*执行体*/
i:=0;
for i in 1 .. 100 loop
insert into tb_objects select * from dba_objects;
commit;
end loop;
commit;
END;
执行:
DECLARE
BEGIN
HXL."sp_insert_data"();
END
我这里是在DM管理工具里执行的
命令行模式
SQL> HXL."sp_insert_data"();
DMSQL executed successfully
used time: 00:00:06.199. Execute id is 56200.
小心的存储过程名使用双引号引起来,大写的好像不需要
SQL> SP_DATA();