CREATE OR REPLACE PACKAGE p_lee01
IS
TYPE cur_lee01 IS REF CURSOR;
END;

CREATE OR REPLACE PROCEDURE pro_lee01(in_a IN NUMBER,out_01 OUT NUMBER,cur_01 OUT p_lee01.cur_lee01) IS
BEGIN 
 out_01 := 3;
 OPEN cur_01 FOR 
      SELECT * FROM TLEE01;
 dbms_output.put_line(IN_a);

END;

-- Create table
create table TLEE01
(
  ID    NUMBER,
  FNAME VARCHAR2(10)
)

----------------------------------
ODAC  两种调用方式

procedure TForm1.Button15Click(Sender: TObject);
begin
  orastoredproc1.Params.clear;
  OraStoredProc1.StoredProcName := 'pro_lee01';
  orastoredproc1.PrepareSQL;
  orastoredproc1.ParamByName('in_a').Value := 5;
  orastoredproc1.prepare;
  OraStoredProc1.ExecProc;
  showmessage(OraStoredProc1.ParamByName('out_01').AsString);
  ShowValue(OraStoredProc1, Button8.Caption);
end;

procedure TForm1.Button9Click(Sender: TObject);
var
  s: string;
begin
  s := 'begin pro_lee01(:a,:b,:cur_01 ); end;';
  OraQuery1.SQL.Clear;
  OraQuery1.SQL.Add(s);
  OraQuery1.AutoCommit := false;
  OraQuery1.FetchAll := true;
  OraQuery1.ParamByName('a').value := 4;
  OraQuery1.ParamByName('b').ParamType := ptoutput;
  OraQuery1.ParamByName('b').DataType:= ftinteger;

OraQuery1.ParamByName('cur_01').ParamType := ptoutput;
  OraQuery1.ParamByName('cur_01').DataType:= ftcursor;
  OraQuery1.Open;

showmessage(OraQuery1.ParamByName('b').AsString);   //显示返回值
  ShowValue(OraQuery1, Button8.Caption);
end;

最新文章

  1. spice server dpkg-buildpackage 打包编译备忘
  2. React笔记整理
  3. Python正则表达式使用实例
  4. hdu1018(数位)
  5. 第38讲:List伴生对象操作方法代码实战
  6. [转]在 Eclipse 中嵌入 NASA World Wind Java SDK
  7. js实现对比百分比
  8. js中推断对象详细类型
  9. linux网络编程学习笔记之四 -----多-threaded服务器
  10. CC/G++ 学习笔记
  11. HQL连接查询
  12. Android 开发笔记___spinner__适配器基础_arrayadapter
  13. Spring 基于注解的AOP实现
  14. [Swift]LeetCode956. 最高的广告牌 | Tallest Billboard
  15. ES 04 - 安装Kibana插件(6.6.0版本)
  16. CSS知识点总结[部分]
  17. linux之cp命令(转载)
  18. 剑指offer(40)数组中只出现一次的数字
  19. openwrt git 代码下载地址
  20. MySQL运行内存不足时应采取的措施

热门文章

  1. Shorthand Argument Names $0 : 只用于指代Closer声明中的形参
  2. CSS3 动画-- 鼠标移上去,div 会旋转、放大、移动
  3. mysql字符集乱码问题
  4. CSS Paint API绘制透明格子背景实例页面
  5. PC端样式重置
  6. [LUOGU] P1316 丢瓶盖
  7. Map集合遍历的方式(以HashMap为例)
  8. PHP中设置session过期的时间
  9. SpringBoot Banner 图片定制修改
  10. ResNet实战