PL/Sql 中创建、调试、调用存储过程
来源:互联网 发布:java.lang.object 编辑:程序博客网 时间:2024/06/09 22:34
存储过程 所用函数说明 功能:求和与差 原形:GetSumAndSub(p1 in number , p2 in number ,m out number , b out number) 参数:m=p1+p2 b=p1-p2 1.先建存储过程 左边的浏览窗口选择 procedures ,会列出所有的存储过程,右击文件夹procedures单击菜单“new",弹出 template wizard窗口, name框中输入 GetSumAndSub ,parameters中填入: p1 in number , p2 in number ,m out number , b out number 。单击ok,右边出现建立存储过程的代码窗口。其中内容为创建存储过程的语句。在begin end 之间输入具体内容,最后如下; create or replace procedure GetSumAndSub(p1 in number , p2 in number ,m out number , b out number) is begin m := p1+p2 ; b := p1-p2 ; end GetSumAndSub; 单击“保存”按钮,可将创建存储过程的sql语句保存在文件中,作备分之用^_^接着要做的就是 执行此sql语句来创建存储过程。方法为:找到工具栏上的“齿轮”图标,鼠标放上面会显示 ‘EXECUTE(F8)',单击之。存储过程此时已经建立完毕。可为什么我在右边的procedures文件夹下看不到此存储过程?刷新一下ok~ 2。测试存储过程 在左边的浏览窗口选中 GetSumAndSub该存储过程,右击选菜单“TEST‘,右边会出现新的测试窗口。 说明:在测试窗口的下面你可以看到有一个参数列表,作输入参数值和查看out型参数值用在调试代码上方有个工具条: 第一个放大镜形(start debugger),开始调试。 第二个绿色三角形(run),执行。 第三个step into ,单步调试。 进入调试代码窗口后,可随意设置断点,方法就不用说了吧~ a 我们要在参数窗口中输入 两个参数值, p1为6,p2为4, m跟b不用填。 b 点击start debugger,进入存储过程的代码窗口 c 点击step into ,将鼠标放在变量符号上可查看变量值 d 继续点击step into 直到单步运行完毕。此时会返回测试窗口。 e 查看参数列表,验证m,b值为8,4。 在测试窗口点击保存,可保存测试代码。以后重新打开时,你原先输入的那些参数值会保存在其中,免得每次测试都要重新输参数值。 对于返回类型为游标的参数,数据不会直接显示,在列表的参数值框右边会有一个按扭,点击之,会弹出一个 3、Oracle中调用存储过程DECLARE p1 VARCHAR2(100); p2 VARCHAR2(100); p3 VARCHAR2(100);BEGIN p1:='dd'; p2:='3'; testprocedure(p1,p2,'');END;如果需要其他表的字段来确定输入输出类型表名.字段%typecreate or replace procedure GetSumAndSub(p1 in test.age%type , p2 in number ,m out test.id%type , b out number,j out number) isbegin m :=p1+p2; b :=p1-p2; j :=p1*p2;end GetSumAndSub;查询结果赋给变量值用 --a,b into c,dcreate or replace procedure GetSumAndSubByTable(userid in test.id%type,m out test.name%type,a out test.age%type) isbeginselect name,age into m,a from test where id = userid;end GetSumAndSubByTable;存储过程中调用存储过程create or replace procedure GetSumAndSub(p1 in varchar2 , p2 in varchar2 ,m out test.id%type , b out varchar2) isbegin m :=p1+p2; b :=p1-p2;end GetSumAndSub;create or replace procedure GetSumAndSubByTable(userid in test.id%type,m out test.name%type,a out test.age%type,b out test.age%type,d out test.age%type) isbeginselect name,age into m,a from test where id = userid;getsumandsub(m,a,b,d);end GetSumAndSubByTable;
0 0
- PL/Sql 中创建、调试、调用存储过程
- PL/Sql 中创建、调试、调用存储过程
- pl sql developer中如何调试存储过程以及调试包中创建的存储过程
- pl/sql developer中调试存储过程
- PL/SQL调试存储过程
- PL/SQL调试存储过程
- PL/SQL 调试存储过程
- PL/SQL调试存储过程
- PL/SQL存储过程调试
- PL/SQL调试存储过程
- PL/SQL存储过程创建
- PL/SQL Developer中调试oracle的存储过程
- PL/SQL中调试存储过程卡死问题解决
- 在java中调用pl/sql编写的存储过程
- 在 PL/SQL 中调用存储过程 oracle
- 在PL/SQL中调用存储过程--oracle
- 【PL/SQL】用SQL调用存储过程
- pl sql develper 如何调试存储过程
- ubuntu 14.0.4.1系统更新后不能打开图形界面
- QT实现图片按钮(用qss切割图片,或者放三张图片)
- ThreadLocal实现简单剖析
- CDH5安装
- Oracle EBS $INST_TOP/ora/10.1.2/forms存在很多core.*文件
- PL/Sql 中创建、调试、调用存储过程
- cloudera manager kerberos配置
- 获取本地ip地址
- Content-Disposition~强制浏览器保存文件
- cloudera client集群部署
- hue beeswax权限管理
- POJ 1251 换成字母编号的最小生成树
- hive常用命令
- FastJson