当前位置:网站首页>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;
}
边栏推荐
- Dynamically switch data sources
- OLED屏幕的使用
- R语言可视化两个以上的分类(类别)变量之间的关系、使用vcd包中的Mosaic函数创建马赛克图( Mosaic plots)、分别可视化两个、三个、四个分类变量的关系的马赛克图
- Kubernetes learning summary (20) -- what is the relationship between kubernetes and microservices and containers?
- 全网最全的新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀
- 什么是RDB和AOF
- 如何实现常见框架
- None of the strongest kings in the monitoring industry!
- use. Net drives the OLED display of Jetson nano
- Performance test process and plan
猜你喜欢
What key progress has been made in deep learning in 2021?
The most comprehensive new database in the whole network, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, flying Book Multidimensional table, heipayun, Zhix
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
APS taps home appliance industry into new growth points
Entity alignment two of knowledge map
硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
逻辑是个好东西
[DIY]自己设计微软MakeCode街机,官方开源软硬件
SSO single sign on
No Yum source to install SPuG monitoring
随机推荐
硬件开发笔记(十): 硬件开发基本流程,制作一个USB转RS232的模块(九):创建CH340G/MAX232封装库sop-16并关联原理图元器件
HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
Build your own application based on Google's open source tensorflow object detection API video object recognition system (IV)
Recyclerview GridLayout bisects the middle blank area
OAI 5G NR+USRP B210安装搭建
知识图谱之实体对齐二
如何实现常见框架
审稿人dis整个研究方向已经不仅仅是在审我的稿子了怎么办?
小孩子學什麼編程?
Comprehensive evaluation and recommendation of the most comprehensive knowledge base management tools in the whole network: flowus, baklib, jiandaoyun, ones wiki, pingcode, seed, mebox, Yifang cloud,
Design your security architecture OKR
Value of APS application in food industry
Intel 48 core new Xeon run point exposure: unexpected results against AMD zen3 in 3D cache
OSPF多区域配置
LLVM之父Chris Lattner:为什么我们要重建AI基础设施软件
华为设备命令
1500万员工轻松管理,云原生数据库GaussDB让HR办公更高效
【OpenCV 例程200篇】220.对图像进行马赛克处理
SAP Fiori应用索引大全工具和 SAP Fiori Tools 的使用介绍
Solution to the 38th weekly match of acwing