Create table
create table A
(
USERID NUMBER()
PWD VARCHAR()
)
tablespace USERS
pctfree
initrans
maxtrans
storage
(
initial K
minextents
maxextents unlimited
);
======================================
创建procedure
create or replace procedure up_sel(cur_test out sys_refcursor)
is
begin
open cur_test for
select * from a;
end;
删除存储过程
drop procedure up_sel
提交
commit
在PL/sql中执行procedure
// file>>new >>test window
begin
Call the procedure
up_sel(cur_test => :cur_test);
end;
//在variable中填入定义的游标名 cur_test
//在Type中填入游标类型 Cursor
//点击Value 右边的 图标即可显示出所要的结果
**当然也可直接右击存储过程后点TEST
===============================
删除数据的存储过程
create or replace procedure up_del
(userid in varchar)
is
begin
delete from a where USERID=userid;
end;
//** 要在value中填入要传入的值
增加数据
create or replace procedure up_add
(
userid in varchar
pwd in varchar
)
is
begin
insert into a(USERIDPWD) values(useridpwd);
commit;
end;
执行
declare
begin
up_add();
end;