PL/SQL 创建带输入参数的存储过程和循环语法
时间:2011-02-28 来源:umen
for v in 1..p_line loop
for m in 1..p_line-v loop
dbms_output.put(' ');
end loop;
for n in 1..2*v-1 loop
dbms_output.put('*');
end loop;
dbms_output.put_line('');
end loop;
end test_yurui;
带异常处理
CREATE OR REPLACE PROCEDURE Write_Runreport(Vproc_Name VARCHAR2,
Voperate_Desc VARCHAR2,
Vproc_Info VARCHAR2,
Vsys_Info VARCHAR2,
Vuser_Account VARCHAR2,
Vbegin_Time DATE) AS
BEGIN
--写运行错误报告*****************************
INSERT INTO SA_Run_Report
(Run_Report_Id, Proc_Name, Operate_Desc, Proc_Info, Sys_Info,
User_Account, Begin_Time, End_Time)
VALUES
(SEQ_SA.NEXTVAL, Vproc_Name, Voperate_Desc, Vproc_Info,
Vsys_Info, NVL(Vuser_Account,'Admin'), Vbegin_Time, SYSDATE);
EXCEPTION
WHEN OTHERS THEN
NULL;
END;