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;

delphi调用oracle存储过程(ODAC)的更多相关文章

  1. MyBatis调用Oracle存储过程

    MyBatis调用Oracle存储过程 1.无输入和输出参数的存储过程 2.带有输入和输出参数的存储过程 3.返回游标的存储过程 mybatis中的配置文件代码 <resultMap type= ...

  2. Java调用oracle存储过程通过游标返回临时表数据

    注:本文来源于 <  Java调用oracle存储过程通过游标返回临时表数据   > Java调用oracle存储过程通过游标返回临时表数据 项目开发过程中,不可避免的会用到存储过程返回结 ...

  3. C#调用Oracle存储过程

    C#调用Oracle存储过程的代码如下所示: using System; using System.Collections.Generic; using System.Collections.Obje ...

  4. C#调用 oracle存储过程

    C#调用oracle 存储过程与调用Sql server存储过程类似,比较简单:直接给出示例: /// <summary> /// 判断物料类型是不是总部管控 /// </summa ...

  5. 123 c#调用oracle存储过程返回数据集 --通过oracle存储过程返回数据集

    c#调用oracle存储过程返回数据集 2008-12-20 10:59:57|  分类: net|字号 订阅   CREATE OR REPLACE PACKAGE pkg_tableTypeIS  ...

  6. c#调用oracle存储过程返回数据集

    c#调用oracle存储过程返回数据集 2008-12-20 10:59:57|  分类: net|字号 订阅   CREATE OR REPLACE PACKAGE pkg_tableTypeIS  ...

  7. C#调用Oracle存储过程的方法

    C#调用Oracle存储过程的方法 准备: 环境:pl/sql+oracle9i+vs2008 创建表test: create table TEST(  ID      NUMBER,//编号  NA ...

  8. Oracle创建表语句(Create table)语法详解及示例、、 C# 调用Oracle 存储过程返回数据集 实例

    Oracle创建表语句(Create table)语法详解及示例 2010-06-28 13:59:13|  分类: Oracle PL/SQL|字号 订阅 创建表(Create table)语法详解 ...

  9. python调用oracle存储过程

    oracle 存储过程 python调用oracle存储过程 -- 通过cx_Oracle连接 import cx_Oracle # 连接数据库 orcl_engine = 'scott/s123@x ...

随机推荐

  1. Android开发使用的常见第三方框架汇总

    本文转载:http://blog.csdn.net/liuhaomatou/article/details/44857005 1.volley 项目地址 https://github.com/sman ...

  2. R in action读书笔记(11)-第八章:回归-- 选择“最佳”的回归模型

    8.6 选择“最佳”的回归模型 8.6.1 模型比较 用基础安装中的anova()函数可以比较两个嵌套模型的拟合优度.所谓嵌套模型,即它的一 些项完全包含在另一个模型中 用anova()函数比较 &g ...

  3. vue2.0 路由知识一(路由的创建的全过程)

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  4. (转)淘淘商城系列——发布dubbo服务

    http://blog.csdn.net/yerenyuan_pku/article/details/72758639 Dubbo采用全Spring配置方式,透明化接入应用,对应用没有任何API侵入, ...

  5. 用cesium本身添加水纹效果

    参考网站:https://blog.csdn.net/XLSMN/article/details/78752669 1.首先来看一下整体效果 2.具体方法如下: 首先,你必须有两张很重要的图片,你可以 ...

  6. vue2.0学习——使用webstorm创建一个vue项目

    https://blog.csdn.net/weixin_40877388/article/details/80911934

  7. 【HTML5】可以省略标记的元素

  8. 02Hibernate基本配置

    Hibernate基本配置 1.引入jar 2.建立项目 3.创建实体类 package com.sqlserver.domain; public class Customer { long cust ...

  9. intellij idea集成github

    IDEA配置github并上传项目 http://www.cnblogs.com/jinjiyese153/p/6796668.html github ssl验证 https://www.cnblog ...

  10. js-时间戳转字符串

    function createTime(v){ var now = new Date(v); var yy = now.getFullYear(); //年 var mm = now.getMonth ...