当前位置:网站首页>c#使用oracle存储过程获取结果集实例
c#使用oracle存储过程获取结果集实例
2022-07-06 12:44:00 【51CTO】
存储过程:
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#代码:
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;
}
边栏推荐
- Gui Gui programming (XIII) - event handling
- 电子游戏的核心原理
- Boder radius has four values, and boder radius exceeds four values
- "Penalty kick" games
- 使用.Net驱动Jetson Nano的OLED显示屏
- Taylor series fast Fourier transform (FFT)
- [DIY]如何制作一款個性的收音機
- 【DSP】【第一篇】开始DSP学习
- “罚点球”小游戏
- Tips for web development: skillfully use ThreadLocal to avoid layer by layer value transmission
猜你喜欢
![Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]](/img/cf/58a62a7134ff5e9f8d2f91aa24c7ac.png)
Mécanisme de fonctionnement et de mise à jour de [Widget Wechat]

Implementation of packaging video into MP4 format and storing it in TF Card

新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀
![[DIY]自己设计微软MakeCode街机,官方开源软硬件](/img/a3/999c1d38491870c46f380c824ee8e7.png)
[DIY]自己设计微软MakeCode街机,官方开源软硬件

Comment faire une radio personnalisée

SAP UI5 框架的 manifest.json
![[DSP] [Part 2] understand c6678 and create project](/img/06/54b1cf1f5b3308fffb4f84dcf7db9b.png)
[DSP] [Part 2] understand c6678 and create project

Trends of "software" in robotics Engineering

Manifest of SAP ui5 framework json

Performance test process and plan
随机推荐
How to upgrade high value-added links in the textile and clothing industry? APS to help
[DSP] [Part 2] understand c6678 and create project
Intel 48 core new Xeon run point exposure: unexpected results against AMD zen3 in 3D cache
recyclerview gridlayout 平分中间空白区域
Logic is a good thing
Redis insert data garbled solution
Event center parameter transfer, peer component value transfer method, brother component value transfer
Function optimization and arrow function of ES6
R语言可视化两个以上的分类(类别)变量之间的关系、使用vcd包中的Mosaic函数创建马赛克图( Mosaic plots)、分别可视化两个、三个、四个分类变量的关系的马赛克图
Unity writes a timer tool to start timing from the whole point. The format is: 00:00:00
“罚点球”小游戏
[DIY]如何制作一款個性的收音機
Web开发小妙招:巧用ThreadLocal规避层层传值
【微信小程序】运行机制和更新机制
Solution to the 38th weekly match of acwing
2110 summary of knowledge points and common problems in redis class
PHP online examination system version 4.0 source code computer + mobile terminal
Spark SQL chasing Wife Series (initial understanding)
电子游戏的核心原理
APS taps home appliance industry into new growth points