oracle 创建存储过程:
create or replace procedure p_procedure_name
as
CURSOR cur_1 IS
SELECT clumn
from table ;
begin
FOR rec IN cur_1 LOOP
Dbms_output.Put_line(rec.clumn );
update table set table.clumn = rec.clumn ;
commit;
END LOOP;
Dbms_output.Put_line(‘打印日期’);
commit;
RETURN;
EXCEPTION
when others then
rollback;
return;
END p_change_date_format;
其中,简单创建存储过程为:
create or replace procedure p_procedure_name
as
begin
Dbms_output.Put_line(‘打印日期’);
commit;
RETURN;
EXCEPTION
when others then
rollback;
return;
END p_change_date_format;
游标声明:
CURSOR cur_1 IS
SELECT clumn
from table ;
游标使用:
begin
FOR rec IN cur_1 LOOP
Dbms_output.Put_line(rec.clumn );
update table set table.clumn = rec.clumn ;
commit;
END LOOP;