当前位置:网站首页>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;
}
边栏推荐
- Extraction rules and test objectives of performance test points
- 【DSP】【第一篇】开始DSP学习
- R language visualizes the relationship between more than two classification (category) variables, uses mosaic function in VCD package to create mosaic plots, and visualizes the relationship between tw
- Laravel notes - add the function of locking accounts after 5 login failures in user-defined login (improve system security)
- [DSP] [Part 1] start DSP learning
- Database - how to get familiar with hundreds of tables of the project -navicat these unique skills, have you got it? (exclusive experience)
- [wechat applet] operation mechanism and update mechanism
- JMeter server resource indicator monitoring (CPU, memory, etc.)
- Detailed introduction of distributed pressure measurement system VIII: basic introduction of akka actor model
- Dynamically switch data sources
猜你喜欢

Intel 48 core new Xeon run point exposure: unexpected results against AMD zen3 in 3D cache

Event center parameter transfer, peer component value transfer method, brother component value transfer

【微信小程序】运行机制和更新机制

APS taps home appliance industry into new growth points
![[diy] how to make a personalized radio](/img/fc/a371322258131d1dc617ce18490baf.jpg)
[diy] how to make a personalized radio

15 millions d'employés sont faciles à gérer et la base de données native du cloud gaussdb rend le Bureau des RH plus efficace

PHP online examination system version 4.0 source code computer + mobile terminal

知识图谱构建流程步骤详解
![[wechat applet] operation mechanism and update mechanism](/img/cf/58a62a7134ff5e9f8d2f91aa24c7ac.png)
[wechat applet] operation mechanism and update mechanism

设计你的安全架构OKR
随机推荐
Application layer of tcp/ip protocol cluster
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,
Activiti global process monitors activitieventlistener to monitor different types of events, which is very convenient without configuring task monitoring in acitivit
[DIY]如何制作一款個性的收音機
新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀
Design your security architecture OKR
Use of OLED screen
2022 portal crane driver registration examination and portal crane driver examination materials
APS taps home appliance industry into new growth points
SSO single sign on
基于STM32单片机设计的红外测温仪(带人脸检测)
【微信小程序】運行機制和更新機制
Function optimization and arrow function of ES6
Hardware development notes (10): basic process of hardware development, making a USB to RS232 module (9): create ch340g/max232 package library sop-16 and associate principle primitive devices
华为设备命令
Extraction rules and test objectives of performance test points
What programming do children learn?
What are RDB and AOF
正则表达式收集
New database, multidimensional table platform inventory note, flowus, airtable, seatable, Vig table Vika, Feishu multidimensional table, heipayun, Zhixin information, YuQue