当前位置:网站首页>C # use Oracle stored procedure to obtain result set instance
C # use Oracle stored procedure to obtain result set instance
2022-07-06 20:57:00 【51CTO】
stored procedure :
create or replace PACKAGE FIRSTPAGE AS
/* TODO enter package declarations (types, exceptions, methods etc) here */
type v_cursor is REF CURSOR;
procedure getnumber(re_cursor out v_cursor);
END FIRSTPAGE;
create or replace PACKAGE BODY FIRSTPAGE AS
procedure getnumber(re_cursor out v_cursor) AS
BEGIN
/* TODO implementation required */
open re_cursor for
select * from testable;
END getnumber;
END FIRSTPAGE;
C# Code :
public DataSet GetTableByProcedure()
{
OracleConnection con = new OracleConnection(_connectionString);
OracleCommand cmd = new OracleCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "firstpage.getnumber";
OracleParameter sp = new OracleParameter("re_cursor", OracleType.Cursor);
sp.Direction = ParameterDirection.Output;
cmd.Parameters.Add(sp);
OracleDataAdapter da = new OracleDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
cmd.Dispose();
con.Close();
con.Dispose();
return ds;
}
边栏推荐
- OneNote 深度评测:使用资源、插件、模版
- No Yum source to install SPuG monitoring
- Pytest (3) - Test naming rules
- [DIY]如何制作一款个性的收音机
- Web开发小妙招:巧用ThreadLocal规避层层传值
- R语言可视化两个以上的分类(类别)变量之间的关系、使用vcd包中的Mosaic函数创建马赛克图( Mosaic plots)、分别可视化两个、三个、四个分类变量的关系的马赛克图
- [asp.net core] set the format of Web API response data -- formatfilter feature
- Trends of "software" in robotics Engineering
- PG基础篇--逻辑结构管理(事务)
- [diy] how to make a personalized radio
猜你喜欢

OAI 5G NR+USRP B210安装搭建

SAP Fiori应用索引大全工具和 SAP Fiori Tools 的使用介绍
![[DIY]如何制作一款个性的收音机](/img/fc/a371322258131d1dc617ce18490baf.jpg)
[DIY]如何制作一款个性的收音机

看过很多教程,却依然写不好一个程序,怎么破?

【OpenCV 例程200篇】220.对图像进行马赛克处理

知识图谱之实体对齐二

监控界的最强王者,没有之一!

【mysql】游标的基本使用
![[diy] how to make a personalized radio](/img/fc/a371322258131d1dc617ce18490baf.jpg)
[diy] how to make a personalized radio

2022 construction electrician (special type of construction work) free test questions and construction electrician (special type of construction work) certificate examination
随机推荐
使用.Net驱动Jetson Nano的OLED显示屏
Performance test process and plan
拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条
Application layer of tcp/ip protocol cluster
OSPF多区域配置
性能测试过程和计划
Common doubts about the introduction of APS by enterprises
Notes - detailed steps of training, testing and verification of yolo-v4-tiny source code
Pycharm remote execution
电子游戏的核心原理
全网最全的知识库管理工具综合评测和推荐:FlowUs、Baklib、简道云、ONES Wiki 、PingCode、Seed、MeBox、亿方云、智米云、搜阅云、天翎
Pinduoduo lost the lawsuit, and the case of bargain price difference of 0.9% was sentenced; Wechat internal test, the same mobile phone number can register two account functions; 2022 fields Awards an
动态切换数据源
15million employees are easy to manage, and the cloud native database gaussdb makes HR office more efficient
【每周一坑】计算100以内质数之和 +【解答】输出三角形
【OpenCV 例程200篇】220.对图像进行马赛克处理
PHP online examination system version 4.0 source code computer + mobile terminal
Variable star --- article module (1)
R語言可視化兩個以上的分類(類別)變量之間的關系、使用vcd包中的Mosaic函數創建馬賽克圖( Mosaic plots)、分別可視化兩個、三個、四個分類變量的關系的馬賽克圖
2022 construction electrician (special type of construction work) free test questions and construction electrician (special type of construction work) certificate examination