Oracle 存 储过程总结1、创建存 储过程createorreplaceproceduretest(var_name_1intype,var_name_2outtype)as--声明变量(变量名变量类型)begin--存 储过程的执行体endtest;打印出输入的时间信息E
g:createorreplaceproceduretest(workDateinDate)isbegindbms_output
putline(Theinputdateis:||to_date(workDate,yyyy-mm-dd));endtest;2、变量赋值变量名 :=值;E
g:createorreplaceproceduretest(workDateinDate)isxnumber(4,2);beginx := 1;end test;3、 判断语句:if 比较式 then begin end; end if;E
gcreate or replace procedure test(x in number) isbeginif x >0 thenbeginx := 0 - x;end;end if;if x = 0 thenbeginx: = 1;end;end if;end test;4、 For 循环For
LOOP--执 行 语 句end LOOP;(1)循 环 遍 历 游 标create or replace procedure test() asCursor cursor is select name from student;name varchar(20);beginfor name in cursor LOOPbegindbms_output
putline(name);end;end LOOP;end test;(2)循 环 遍 历 数 组creat