首页 > 代码库 > oracle 存储过程

oracle 存储过程

--建表create table xuesheng(id integer, xing_ming varchar2(25), yu_wen number, shu_xue number);insert into xuesheng values(1,zhangsan,80,90);insert into xuesheng values(2,lisi,85,87);select * from xuesheng;--创建第一个存储过程create or replace procedure xs_proc_no isbegin       insert into xuesheng values(3,wangxu,90,90);commit;end xs_proc_no;--创建第二个存储过程create or replace procedure xs_proc(temp_name in varchar2,temp_num out number)isnum_1 number;num_2 number;begin      select yu_wen,shu_xue      into num_1,num_2      from xuesheng      where xing_ming = temp_name;      temp_num :=num_1 + num_2;end;--创建游标create or replace package mypackage as  type my_cursor is ref cursor;end mypackage;--创建第三个存储过程create or replace procedure xs_proc_list(shuxue   in number,                                         p_cursor out mypackage.my_cursor) isbegin  open p_cursor for    select * from xuesheng where shu_xue > shuxue;end xs_proc_list;

myeclipse 测试 下载地址

http://pan.baidu.com/s/1eQ7qSH8