当前位置:网站首页>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;
}
边栏推荐
- OSPF多区域配置
- [wechat applet] operation mechanism and update mechanism
- Activiti global process monitors activitieventlistener to monitor different types of events, which is very convenient without configuring task monitoring in acitivit
- Performance test process and plan
- Can novices speculate in stocks for 200 yuan? Is the securities account given by qiniu safe?
- 2022 Guangdong Provincial Safety Officer C certificate third batch (full-time safety production management personnel) simulation examination and Guangdong Provincial Safety Officer C certificate third
- Implementation of packaging video into MP4 format and storing it in TF Card
- Regular expression collection
- Pytest (3) - Test naming rules
- Rhcsa Road
猜你喜欢
Build your own application based on Google's open source tensorflow object detection API video object recognition system (IV)
【每周一坑】计算100以内质数之和 +【解答】输出三角形
知识图谱之实体对齐二
The mail command is used in combination with the pipeline command statement
How does kubernetes support stateful applications through statefulset? (07)
Common doubts about the introduction of APS by enterprises
逻辑是个好东西
性能测试过程和计划
Logic is a good thing
小孩子學什麼編程?
随机推荐
(工作记录)2020年3月11日至2021年3月15日
【每周一坑】计算100以内质数之和 +【解答】输出三角形
Simple continuous viewing PTA
Spark SQL chasing Wife Series (initial understanding)
Boder radius has four values, and boder radius exceeds four values
7. Data permission annotation
[asp.net core] set the format of Web API response data -- formatfilter feature
新型数据库、多维表格平台盘点 Notion、FlowUs、Airtable、SeaTable、维格表 Vika、飞书多维表格、黑帕云、织信 Informat、语雀
[wechat applet] operation mechanism and update mechanism
Web开发小妙招:巧用ThreadLocal规避层层传值
Leetcode question 448 Find all missing numbers in the array
2022 construction electrician (special type of construction work) free test questions and construction electrician (special type of construction work) certificate examination
Spiral square PTA
Rhcsa Road
[DSP] [Part 2] understand c6678 and create project
【每周一坑】信息加密 +【解答】正整数分解质因数
B-jiege's tree (pressed tree DP)
Value of APS application in food industry
SAP Fiori应用索引大全工具和 SAP Fiori Tools 的使用介绍
【DSP】【第二篇】了解C6678和创建工程