读书人

存储过程跟触发器简单学习

发布时间: 2013-03-01 18:33:02 作者: rapoo

存储过程和触发器简单学习

1.存储过程

2.触发器

3.存储过程和函数的区别

--------------------------------

一、存储过程

?????? 1.基本的语法格式


存储过程跟触发器简单学习
?

?返回值是一个游标的例子

???????????????????????????????????????????????????????????????? 方法一 系统个人游标 sys_refcursor

在自定义函数中

declare        tt_1 sys_refcursor;        tt_id number;        tt_num number;        begin                   -- ceshi_procedure(tt_1);  过程       --   tt_1:=ceshi_cursor;       方法       tt_1:=ceshi_package.p_cursor;包方法          --open tt_1;                     不用打开的          fetch tt_1 into tt_id,tt_num;          while tt_1%found            loop            dbms_output.put_line(to_char(tt_id));            dbms_output.put(to_char(tt_num));            fetch tt_1 into tt_id,tt_num;            end loop;            close tt_1;            end;          

?

?

读书人网 >其他数据库

热点推荐