oracle PLSQL创建和调用存储过程

来源:互联网 发布:usb摄像头监控软件 编辑:程序博客网 时间:2024/09/21 09:22

我是在PLSQL的command window里使用的命令


建表 

drop table students;

 create table students(ID int,userName varchar(100),userpass varchar(100),userAge int);
 insert into students values(1,'Jack','jjjaa',23);
 insert into students values(2,'rose','jjjaa',21);
 insert into students values(3,'lucy','jjjaa',22);
 insert into students values(4,'Tony','jjjaa',24);

 commit;


创建储存过程


create or replace procedure gogogo(uName in varchar, Age in int) is
begin
  update students set UserAge = UserAge + Age where userName = uName;
  commit;
end gogogo;

/



调用储存过程

exec SP_UPDATE_AGE('jack',1);








0 0
原创粉丝点击