create or replace procedure tablespace_test is
---as/is 都可以
v_cs int;
begin
v_cs:=0;
--while循环
while v_cs<3 loop
insert into TABLESPACETEST
select * from TABLESPACETEST;
commit;
v_cs:=v_cs+1;
end loop;
--简单循环
/**loop
v_cs:=v_cs+1;
insert into TABLESPACETEST
select * from TABLESPACETEST;
commit;
exit when v_cs = 3;
end loop;
**/
--for
/**v_cs:=v_cs+1;
for v_cs in 1..3 loop
insert into TABLESPACETEST
select * from TABLESPACETEST;
commit;
end loop;
**/
end ;
ORACLE存储过程简单的循环使用(FOR,WHILE,LOOP)
最新推荐文章于 2024-06-05 17:23:30 发布