当前位置:网站首页>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;
}
边栏推荐
- 【每周一坑】正整数分解质因数 +【解答】计算100以内质数之和
- Regular expression collection
- PHP saves session data to MySQL database
- SSO single sign on
- 请问sql group by 语句问题
- 2022 nurse (primary) examination questions and new nurse (primary) examination questions
- 2110 summary of knowledge points and common problems in redis class
- 3D人脸重建:从基础知识到识别/重建方法!
- Value of APS application in food industry
- 新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀
猜你喜欢

Performance test process and plan

Common doubts about the introduction of APS by enterprises
![[weekly pit] positive integer factorization prime factor + [solution] calculate the sum of prime numbers within 100](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[weekly pit] positive integer factorization prime factor + [solution] calculate the sum of prime numbers within 100

防火墙基础之外网服务器区部署和双机热备

Distributed ID

No Yum source to install SPuG monitoring

New database, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, Feishu multidimensional table, heipayun, Zhixin information, YuQue

Logic is a good thing

Gui Gui programming (XIII) - event handling

拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条
随机推荐
【DSP】【第一篇】开始DSP学习
Web开发小妙招:巧用ThreadLocal规避层层传值
[weekly pit] positive integer factorization prime factor + [solution] calculate the sum of prime numbers within 100
基于STM32单片机设计的红外测温仪(带人脸检测)
OLED屏幕的使用
2022 refrigeration and air conditioning equipment installation and repair examination contents and new version of refrigeration and air conditioning equipment installation and repair examination quest
[weekly pit] calculate the sum of primes within 100 + [answer] output triangle
拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条
use. Net drives the OLED display of Jetson nano
3D人脸重建:从基础知识到识别/重建方法!
What are RDB and AOF
Dynamically switch data sources
OLED屏幕的使用
【微信小程序】运行机制和更新机制
Trends of "software" in robotics Engineering
如何实现常见框架
C language operators
SAP Fiori应用索引大全工具和 SAP Fiori Tools 的使用介绍
What is the problem with the SQL group by statement
Gui Gui programming (XIII) - event handling