--建表 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 is begin 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)is num_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) is begin open p_cursor for select * from xuesheng where shu_xue > shuxue; end xs_proc_list;
myeclipse 测试 下载地址
http://pan.baidu.com/s/1eQ7qSH8
原文:http://www.cnblogs.com/mrgong/p/3837841.html