http://www.2cto.com/database/201204/127180.html

oracle实现存储过程返回查询结果集合的方法
 
--实现存储过程返回查询结果集合的方法 ,以下代码来自网络整理 
http://topic.csdn.net/u/20090721/12/ba403739-3212-4016-83ec-2a7062f21081.html 
Java代码  
--第一种方法  
create or replace Package SYSBasic  
as  www.2cto.com    
  type cc_cursor is ref cursor;  
end SYSBasic;  
  
CREATE OR REPLACE PROCEDURE getall(  
    c_CurSor OUT SYSBASIC.cc_CURSOR  --光标结果  
)  
begin  
  open c_CurSor For  
    select * from table1;  
end getall;   www.2cto.com   
    
--第二种方法  
create or replace procedure p_test(p_cur out sys_refcursor)as   
begin   
   open p_cur for select  * from emp;  
end p_test;  
  
  
在sqlplus界面:  
 SQL> var r refcursor;  
 SQL> exec p_test(:r);  
 SQL> print r;  
 ================================================================
使用pl/sql进行调用查看见如下链接:
 http://blog.csdn.net/kimizhou_blog/article/details/39340851
 ================================================================
create or replace procedure pro_getchart(chart_cur out sys_refcursor) is

begin

  open chart_cur for
select * from dic_chart; end pro_getchart;
 

oracle存储过程返回结果集的更多相关文章

  1. oracle 存储过程返回结果集 (转载)

    好久没上来了, 难道今天工作时间稍有空闲, 研究了一下oracle存储过程返回结果集. 配合oracle临时表, 使用存储过程来返回结果集的数据读取方式可以解决海量数据表与其他表的连接问题. 在存储过 ...

  2. oracle 存储过程 返回结果集

      oracle 存储过程 返回结果集 CreationTime--2018年8月14日09点50分 Author:Marydon 1.情景展示 oracle存储过程如何返回结果集 2.解决方案 最简 ...

  3. oracle 存储过程返回结果集

    好久没上来了, 难道今天工作时间稍有空闲, 研究了一下oracle存储过程返回结果集. 配合oracle临时表, 使用存储过程来返回结果集的数据读取方式可以解决海量数据表与其他表的连接问题. 在存储过 ...

  4. 160307、Java调用Oracle存储过程返回结果集

    一:无返回值的存储过程调用 存储过程: CREATE OR REPLACE PROCEDURE PRO_1(PARA1 IN VARCHAR2,PARA2 IN VARCHAR2)   AS BEGI ...

  5. C#中使用Oracle存储过程返回结果集

    问题: 在MSSQLServer中定义的存储过程可以直接返回一个数据集,如: create procedure sp_getAllEmployees as SELECT * FROM [NORTHWN ...

  6. PB中用oracle的存储过程返回记录集做数据源来生成数据窗口,PB会找不到此存储过程及不能正常识别存储过程的参数问题(转)

    (转)在PB中用oracle的存储过程返回记录集做数据源来生成数据窗口 首先oracle的存储过程写法与MSSQL不一样,差别比较大. 如果是返回数据集的存储过程则需要利用oracle的包来定义游标. ...

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

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

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

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

  9. PostgreSQL 调用存储过程返回结果集

    创建返回结果集类型的存储过程: CREATE OR REPLACE FUNCTION public.f_get_member_info( id integer, productname charact ...

随机推荐

  1. Mybatis 示例之 Association - 偶尔记一下 - 博客频道 - CSDN.NET

    body { font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI ...

  2. (译)Windsor入门教程---第二部分 引用Windsor

    原文:http://docs.castleproject.org/Windsor.Windsor-tutorial-ASP-NET-MVC-3-application-To-be-Seen.ashx ...

  3. Openlayers实现第一张地图

    <html><head><title>OpenLayers Hello World</title> <style type="text/ ...

  4. shell vim--处理二进制文本

    1 使用vim  -b  :%!xxd 参考:http://www.cnblogs.com/killkill/archive/2010/06/23/1763785.html 2 使用xxd命令 htt ...

  5. 51nod1119(除法取模)

    题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1119 题意:中文题诶- 思路:这题数据比较大直接暴力肯定是不 ...

  6. linux命令学习-3-sysctl

    sysctl 内核变量配置 Usage: sysctl [options] [variable[=value] ...]   NAME sysctl - configure kernel parame ...

  7. Memcached源码分析之assoc.c

    #include "memcached.h" #include <sys/stat.h> #include <sys/socket.h> #include ...

  8. IOS开发-ObjC-NSDictionary

    OC中Foundation框架中有字典类,字典分不可变字典(NSDictionary)和可变字典(NSMutableDictionary),它们的使用如下: 不可变字典: //------------ ...

  9. iOS数据存储

    [reference]http://www.infoq.com/cn/articles/data-storage-in-ios 谈到数据储存,首先要明确区分两个概念,数据结构和储存方式.所谓数据结构就 ...

  10. 深入了解Bundle和Map

    [转]http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0402/2684.html 前言 因为往Bundle对象中放入Map实际上 ...